From: David Galloway Date: Thu, 19 Oct 2017 15:20:15 +0000 (-0400) Subject: ansible: s/sudo/become X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=23316ab4b48a96707b6a671b9445a5513090b66a;p=ceph-build.git ansible: s/sudo/become Signed-off-by: David Galloway --- diff --git a/ansible/slave.yml b/ansible/slave.yml index b9a09aa5..4ac14f5b 100644 --- a/ansible/slave.yml +++ b/ansible/slave.yml @@ -1,7 +1,7 @@ --- - hosts: all - sudo: true + become: true user: ubuntu vars: - jenkins_user: 'jenkins-build' @@ -72,7 +72,6 @@ key: "{{ lookup('file', 'playbook/files/ssh/keys/jenkins_build.pub') }}" - name: "ensure {{ jenkins_user }} can sudo without a prompt" - sudo: yes lineinfile: dest: /etc/sudoers regexp: '^{{ jenkins_user }} ALL' @@ -114,7 +113,6 @@ recurse: yes - name: Install RPM requirements - sudo: yes yum: name: "{{ item }}" state: present @@ -154,7 +152,6 @@ when: ansible_pkg_mgr == "apt" - name: Install DEB requirements - sudo: yes apt: name: "{{ item }}" state: present @@ -186,7 +183,6 @@ when: ansible_pkg_mgr == "apt" - name: Add the Debian Jessie Key - sudo: yes apt_key: id: 2B90D010 url: https://ftp-master.debian.org/keys/archive-key-8.asc @@ -195,7 +191,6 @@ when: ansible_pkg_mgr == "apt" - name: Add the Debian Security Jessie Key - sudo: yes apt_key: id: C857C906 url: https://ftp-master.debian.org/keys/archive-key-8-security.asc @@ -204,7 +199,6 @@ when: ansible_pkg_mgr == "apt" - name: Add the Debian Jessie Stable Key - sudo: yes apt_key: keyserver: pgp.mit.edu id: 518E17E1 @@ -257,26 +251,22 @@ owner: "{{ jenkins_user }}" - name: Set Hostname with hostname command - sudo: yes hostname: name: "ceph-builders" - name: ensure that 127.0.1.1 is present with an actual hostname - sudo: true lineinfile: backup: yes dest: /etc/hosts line: '127.0.1.1 ceph-builders' - name: update etc cloud templates for debian /etc/hosts - sudo: true lineinfile: backup: yes dest: /etc/cloud/templates/hosts.debian.tmpl line: '127.0.1.1 ceph-builders' - name: update etc cloud templates for red hat /etc/hosts - sudo: true lineinfile: backup: yes dest: /etc/cloud/templates/hosts.redhat.tmpl @@ -284,20 +274,17 @@ failed_when: false - name: install six, latest one - sudo: true pip: name: six state: latest - name: install python-jenkins - sudo: true # https://review.openstack.org/460363 pip: name: python-jenkins version: 0.4.15 - name: add github.com host key - sudo: true known_hosts: path: '/etc/ssh/ssh_known_hosts' # we need to use 'host' here because prado currently uses ansible-playbook==1.9.1 diff --git a/ansible/slave_libvirt.yml b/ansible/slave_libvirt.yml index 7300566a..c892ddcd 100644 --- a/ansible/slave_libvirt.yml +++ b/ansible/slave_libvirt.yml @@ -1,7 +1,7 @@ --- - hosts: all - sudo: true + become: true user: ubuntu vars: - jenkins_user: 'jenkins-build' @@ -53,7 +53,6 @@ # around and can get updates as soon as a new vagrant version is published via # chacractl - name: add the vagrant repository - sudo: yes apt_repository: repo: "deb [trusted=yes] https://chacra.ceph.com/r/vagrant/latest/HEAD/ubuntu/xenial/flavors/default/ xenial main" state: present @@ -64,7 +63,6 @@ when: ansible_pkg_mgr == "apt" - name: Install DEB requirements - sudo: yes apt: name: "{{ item }}" state: present @@ -123,7 +121,6 @@ key: "{{ lookup('file', 'playbook/files/ssh/keys/jenkins_build.pub') }}" - name: "ensure {{ jenkins_user }} can sudo without a prompt" - sudo: yes lineinfile: dest: /etc/sudoers regexp: '^{{ jenkins_user }} ALL' @@ -165,7 +162,6 @@ recurse: yes - name: Add the Debian Jessie Key - sudo: yes apt_key: id: 2B90D010 url: https://ftp-master.debian.org/keys/archive-key-8.asc @@ -174,7 +170,6 @@ when: ansible_pkg_mgr == "apt" - name: Add the Debian Security Jessie Key - sudo: yes apt_key: id: C857C906 url: https://ftp-master.debian.org/keys/archive-key-8-security.asc @@ -183,7 +178,6 @@ when: ansible_pkg_mgr == "apt" - name: Add the Debian Jessie Stable Release Key - sudo: yes apt_key: keyserver: pgp.mit.edu id: 75DDC3C4A499F1A18CB5F3C8CBF8D6FD518E17E1 @@ -224,12 +218,10 @@ owner: "{{ jenkins_user }}" - name: Set Hostname with hostname command - sudo: yes hostname: name: "ceph-builders" - name: ensure that 127.0.1.1 is present with an actual hostname - sudo: true lineinfile: dest: /etc/hosts line: '127.0.1.1 ceph-builders' @@ -241,34 +233,29 @@ # not all our images have this setting though, so ignore failures on # those nodes - name: update the etc cloud templates for debian /etc/hosts - sudo: true lineinfile: dest: /etc/cloud/templates/hosts.debian.tmpl line: '127.0.1.1 ceph-builders' failed_when: false - name: update the etc cloud templates for debian /etc/hosts - sudo: true lineinfile: dest: /etc/cloud/templates/hosts.redhat.tmpl line: '127.0.1.1 ceph-builders' failed_when: false - name: install six, latest one - sudo: true pip: name: six state: latest - name: install python-jenkins - sudo: true # https://review.openstack.org/460363 pip: name: python-jenkins version: 0.4.15 - name: add github.com host key - sudo: true known_hosts: path: '/etc/ssh/ssh_known_hosts' # we need to use 'host' here because prado currently uses ansible-playbook==1.9.1 @@ -277,13 +264,11 @@ key: "{{ lookup('file', 'playbook/files/ssh/hostkeys/github.com.pub') }}" - name: start the libvirt-bin service - sudo: true service: name: libvirt-bin state: started - name: start the libvirt-guests service - sudo: true service: name: libvirt-guests state: started