aboutsummaryrefslogtreecommitdiff
path: root/tools/setup_nodes.yml
blob: b61f126dfab96adc814e406cfc4865a331b266c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
- hosts: all
  sudo: yes
  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
  tasks:
  - name: Create log directory for node
    file:
      state: directory
      path: /tmp/{{ inventory_hostname }}

  - name: Run node setup
    shell: sudo /tmp/setup.sh

  - name: Changing permissions of docker socket to 666
    shell: sudo chmod 0666 /run/docker.sock