Allow Jenkins to sudo without a password

This commit is contained in:
Kris Lamoureux 2020-09-15 22:28:42 -04:00
parent bf49f3c648
commit 66dedbcbf7
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
3 changed files with 9 additions and 1 deletions

View File

@ -14,8 +14,15 @@
key: "{{ jenkins_sshkey }}" key: "{{ jenkins_sshkey }}"
when: jenkins_sshkey is defined when: jenkins_sshkey is defined
- name: Install Ansible source - name: Give Jenkins user passwordless sudo
template: template:
src: jenkins_sudoers.j2
dest: /etc/sudoers.d/{{ jenkins_user }}
validate: "visudo -cf %s"
mode: 0440
- name: Install Ansible source
copy:
src: ansible.list src: ansible.list
dest: /etc/apt/sources.list.d/ansible.list dest: /etc/apt/sources.list.d/ansible.list

View File

@ -0,0 +1 @@
{{ jenkins_user }} ALL=(ALL:ALL) NOPASSWD:ALL