2015-11-07 15:58:10 +00:00
|
|
|
---
|
|
|
|
- hosts: all
|
2016-09-29 16:17:48 +02:00
|
|
|
become: true
|
|
|
|
|
2015-11-07 15:58:10 +00:00
|
|
|
tasks:
|
|
|
|
- name: Setup /etc/hosts
|
|
|
|
copy:
|
|
|
|
src: /etc/hosts
|
|
|
|
dest: /etc/hosts
|
|
|
|
|
2016-04-08 09:13:52 -04:00
|
|
|
- name: Ensure /etc/hostname is valid for SELinux
|
|
|
|
command: restorecon -v /etc/hostname
|
|
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
|
2015-11-07 15:58:10 +00:00
|
|
|
- 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
|
2016-09-29 16:17:48 +02:00
|
|
|
become: true
|
|
|
|
|
2015-11-07 15:58:10 +00:00
|
|
|
tasks:
|
|
|
|
- name: Create log directory for node
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
path: /tmp/{{ inventory_hostname }}
|
2016-09-29 16:17:48 +02:00
|
|
|
become: false
|
2015-11-07 15:58:10 +00:00
|
|
|
|
|
|
|
- name: Run node setup
|
2016-09-29 16:17:48 +02:00
|
|
|
shell: /tmp/setup.sh
|
2016-03-26 10:11:32 -07:00
|
|
|
|
2016-09-29 16:17:48 +02:00
|
|
|
- name: Changing permissions of Docker socket to 666
|
|
|
|
file:
|
|
|
|
path: /run/docker.sock
|
|
|
|
mode: 0666
|