kolla-ansible/tools/playbook-setup-nodes.yml
Duong Ha-Quang 2d3866c6a4 Specify 'become' for only necessary tasks (default roles)
Add become to only neccesary tasks in roles:
- glance
- heat
- horizon
- keystone
- neutron
- nova
- openvswitch

Gate is also updated to use 'become' feature

Change-Id: I2f3f27306e9f384148e1ad4d54d8da2ebef34d00
Partial-Implements: blueprint ansible-specific-task-become
2017-10-31 02:55:31 +00:00

40 lines
746 B
YAML

---
- hosts: all
become: true
tasks:
- name: Ensure /etc/hostname is valid for SELinux
command: restorecon -v /etc/hostname
when: ansible_os_family == 'RedHat'
- name: Install wget package
package: name=wget
- name: Add sudo group
group:
name: sudo
state: present
- name: Allow 'sudo' group to have passwordless sudo
lineinfile:
dest: /etc/sudoers
state: present
line: "%sudo ALL=(ALL) NOPASSWD: ALL"
- name: Add jenkins to sudo group
user:
name: jenkins
append: yes
groups: "sudo"
- hosts: all
become: true
tasks:
- name: Create log directory for node
file:
state: directory
path: /tmp/{{ inventory_hostname }}
become: false