Improve playbook to setup gate nodes
* use become instead of sudo * use file instead of shell to change file modes * rename setup_nodes.yml to playbook-setup-nodes.yml Change-Id: I69eda1f034b97d13be76efc91458b6d762c76baf
This commit is contained in:
parent
e974f41b97
commit
ce11216a0e
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
- hosts: all
|
- hosts: all
|
||||||
sudo: yes
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Setup /etc/hosts
|
- name: Setup /etc/hosts
|
||||||
copy:
|
copy:
|
||||||
@ -22,14 +23,19 @@
|
|||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- hosts: all
|
- hosts: all
|
||||||
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Create log directory for node
|
- name: Create log directory for node
|
||||||
file:
|
file:
|
||||||
state: directory
|
state: directory
|
||||||
path: /tmp/{{ inventory_hostname }}
|
path: /tmp/{{ inventory_hostname }}
|
||||||
|
become: false
|
||||||
|
|
||||||
- name: Run node setup
|
- name: Run node setup
|
||||||
shell: sudo /tmp/setup.sh
|
shell: /tmp/setup.sh
|
||||||
|
|
||||||
- name: Changing permissions of docker socket to 666
|
- name: Changing permissions of Docker socket to 666
|
||||||
shell: sudo chmod 0666 /run/docker.sock
|
file:
|
||||||
|
path: /run/docker.sock
|
||||||
|
mode: 0666
|
@ -132,7 +132,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setup_node {
|
function setup_node {
|
||||||
ansible-playbook -i ${RAW_INVENTORY} tools/setup_nodes.yml
|
ansible-playbook -i ${RAW_INVENTORY} tools/playbook-setup-nodes.yml
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup_logging {
|
function setup_logging {
|
||||||
|
Loading…
Reference in New Issue
Block a user