ce11216a0e
* 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
42 lines
799 B
YAML
42 lines
799 B
YAML
---
|
|
- hosts: all
|
|
become: true
|
|
|
|
tasks:
|
|
- name: Setup /etc/hosts
|
|
copy:
|
|
src: /etc/hosts
|
|
dest: /etc/hosts
|
|
|
|
- name: Ensure /etc/hostname is valid for SELinux
|
|
command: restorecon -v /etc/hostname
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
- name: Assign hostname
|
|
hostname:
|
|
name: "{{ inventory_hostname }}"
|
|
|
|
- name: Copy setup script
|
|
copy:
|
|
src: setup_{{ ansible_os_family }}.sh
|
|
dest: /tmp/setup.sh
|
|
mode: 0755
|
|
|
|
- hosts: all
|
|
become: true
|
|
|
|
tasks:
|
|
- name: Create log directory for node
|
|
file:
|
|
state: directory
|
|
path: /tmp/{{ inventory_hostname }}
|
|
become: false
|
|
|
|
- name: Run node setup
|
|
shell: /tmp/setup.sh
|
|
|
|
- name: Changing permissions of Docker socket to 666
|
|
file:
|
|
path: /run/docker.sock
|
|
mode: 0666
|