Allow Jenkins to sudo without a password
This commit is contained in:
parent
bf49f3c648
commit
66dedbcbf7
@ -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
|
||||||
|
|
||||||
|
1
roles/jenkins/templates/jenkins_sudoers.j2
Normal file
1
roles/jenkins/templates/jenkins_sudoers.j2
Normal file
@ -0,0 +1 @@
|
|||||||
|
{{ jenkins_user }} ALL=(ALL:ALL) NOPASSWD:ALL
|
Loading…
Reference in New Issue
Block a user