Merge "Support opera test in functest releng"
[releng.git] / prototypes / openstack-ansible / playbooks / configure-targethosts.yml
1 ---
2 - hosts: all
3   remote_user: root
4   vars_files:
5     - ../var/ubuntu.yml
6   tasks:
7     - name: add public key to host
8       copy:
9         src: ../file/authorized_keys
10         dest: /root/.ssh/authorized_keys
11     - name: configure modules
12       copy:
13         src: ../file/modules
14         dest: /etc/modules
15
16 - hosts: controller
17   remote_user: root
18   vars_files:
19     - ../var/ubuntu.yml
20   tasks:
21     - name: configure network
22       template:
23         src: ../template/bifrost/controller.interface.j2
24         dest: /etc/network/interfaces
25       notify:
26         - restart network service
27   handlers:
28     - name: restart network service
29       shell: "/sbin/ifconfig ens3 0 &&/sbin/ifdown -a && /sbin/ifup -a"
30
31 - hosts: compute
32   remote_user: root
33   vars_files:
34     - ../var/ubuntu.yml
35   tasks:
36     - name: configure network
37       template:
38         src: ../template/bifrost/compute.interface.j2
39         dest: /etc/network/interfaces
40       notify:
41         - restart network service
42   handlers:
43     - name: restart network service
44       shell: "/sbin/ifconfig ens3 0 &&/sbin/ifdown -a && /sbin/ifup -a"
45
46 - hosts: compute01
47   remote_user: root
48   tasks:
49     - name: make nfs dir
50       file: "dest=/images mode=0777 state=directory"
51     - name: configure sdrvice
52       shell: "echo 'nfs        2049/tcp' >>  /etc/services && echo 'nfs        2049/udp' >>  /etc/services"
53     - name: configure NFS
54       copy:
55         src: ../file/exports
56         dest: /etc/exports
57       notify:
58         - restart nfs service
59   handlers:
60     - name: restart nfs service
61       service: name=nfs-kernel-server state=restarted