summaryrefslogtreecommitdiffstats
path: root/prototypes/openstack-ansible/playbooks/configure-targethosts.yml
blob: 538fe17ecb78d521e863782b73c07a3678b897d1 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
- hosts: all
  remote_user: root
  vars_files:
    - ../var/ubuntu.yml
  tasks:
    - name: add public key to host
      copy:
        src: ../file/authorized_keys
        dest: /root/.ssh/authorized_keys
    - name: configure modules
      copy:
        src: ../file/modules
        dest: /etc/modules

- hosts: controller
  remote_user: root
  vars_files:
    - ../var/ubuntu.yml
  tasks:
    - name: configure network
      template:
        src: ../template/bifrost/controller.interface.j2
        dest: /etc/network/interfaces
      notify:
        - restart network service
  handlers:
    - name: restart network service
      shell: "/sbin/ifconfig ens3 0 &&/sbin/ifdown -a && /sbin/ifup -a"

- hosts: compute
  remote_user: root
  vars_files:
    - ../var/ubuntu.yml
  tasks:
    - name: configure network
      template:
        src: ../template/bifrost/compute.interface.j2
        dest: /etc/network/interfaces
      notify:
        - restart network service
  handlers:
    - name: restart network service
      shell: "/sbin/ifconfig ens3 0 &&/sbin/ifdown -a && /sbin/ifup -a"

- hosts: compute01
  remote_user: root
  tasks:
    - name: make nfs dir
      file: "dest=/images mode=0777 state=directory"
    - name: configure sdrvice
      shell: "echo 'nfs        2049/tcp' >>  /etc/services && echo 'nfs        2049/udp' >>  /etc/services"
    - name: configure NFS
      copy:
        src: ../file/exports
        dest: /etc/exports
      notify:
        - restart nfs service
  handlers:
    - name: restart nfs service
      service: name=nfs-kernel-server state=restarted