blob: 166a328f4d5a888e404456ca39b8f6065ea79e18 [file] [log] [blame]
David K. Bainbridgeed101542016-05-18 20:26:15 -07001- name: Ensure MAAS Ansible Config Directory
2 become: yes
3 file:
4 path=/etc/maas/ansible
5 owner=maas
6 group=maas
7 state=directory
David K. Bainbridge5ba01a92016-08-16 14:58:31 -07008 mode=0755
David K. Bainbridgeed101542016-05-18 20:26:15 -07009
David K. Bainbridge5ba01a92016-08-16 14:58:31 -070010- name: Ensure Ansible Roles
David K. Bainbridgeed101542016-05-18 20:26:15 -070011 become: yes
David K. Bainbridge5ba01a92016-08-16 14:58:31 -070012 copy:
13 src: roles
14 dest: /etc/maas/ansible
15 owner: maas
16 group: maas
17 mode: u=rwX,g=rX,o=rX
18 force: true
David K. Bainbridgeed101542016-05-18 20:26:15 -070019
David K. Bainbridge5ba01a92016-08-16 14:58:31 -070020- name: Ensure Role Permissions and Modes
David K. Bainbridgee18f57b2016-05-23 15:40:58 -070021 become: yes
David K. Bainbridge5ba01a92016-08-16 14:58:31 -070022 file:
David K. Bainbridge141d2ab2016-08-26 13:02:33 -070023 path: /etc/maas/ansible/roles
David K. Bainbridge5ba01a92016-08-16 14:58:31 -070024 owner: maas
25 group: maas
26 mode: u=rwX,g=rX,o=rX
27 state: directory
28 recurse: true
David K. Bainbridgeed101542016-05-18 20:26:15 -070029
David K. Bainbridge0820cab2016-06-02 17:43:32 -070030- name: Ensure Ansible Provisioning Script
31 become: yes
32 copy:
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070033 dest=/etc/maas/ansible/{{ item }}
34 src=files/{{ item }}
David K. Bainbridge0820cab2016-06-02 17:43:32 -070035 owner=maas
36 group=maas
37 mode=0755
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070038 with_items:
39 - do-ansible
40 - do-switch
David K. Bainbridge0820cab2016-06-02 17:43:32 -070041
42- name: Ensure Provisioning Log Directory
43 become: yes
44 file:
45 path=/etc/maas/ansible/logs
46 state=directory
47 owner=maas
48 group=maas
49 mode=0755
50
David K. Bainbridge915105d2016-07-06 14:10:08 -070051- name: Capture MAAS API Key
52 become: yes
53 command: maas-region-admin apikey --username={{ maas.user }}
54 register: apikey
55 changed_when: false
56
Charles Chan3c681622016-08-03 21:53:03 -070057- name: Ensure Compute and Switch Node Playbooks
David K. Bainbridgeed101542016-05-18 20:26:15 -070058 become: yes
David K. Bainbridge10b0c112016-05-24 13:17:23 -070059 template:
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070060 src=files/{{ item }}
61 dest=/etc/maas/ansible/{{ item }}
David K. Bainbridgeed101542016-05-18 20:26:15 -070062 owner=maas
63 group=maas
64 mode=0644
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070065 with_items:
66 - compute-node.yml
67 - switch-node.yml
Charles Chan3c681622016-08-03 21:53:03 -070068
David K. Bainbridge906a9a12016-08-25 10:50:45 -070069- name: Ensure Compute and Switch Variable Directory
70 become: yes
71 file:
72 path=/etc/maas/ansible/vars
73 owner=maas
74 group=maas
75 mode=0755
76 state=directory
77
78- name: Ensure Compute and Switch Node Variables
79 become: yes
80 template:
81 src=files/compute-node-vars.yml
82 dest=/etc/maas/ansible/vars/compute-node.yml
83 owner=maas
84 group=maas
85 mode=0644
86
Charles Chan3c681622016-08-03 21:53:03 -070087- name: Ensure Connect Switch Ansible Playbook
88 become: yes
89 copy:
90 dest=/etc/maas/ansible/{{ item }}
91 src=files/{{ item }}
92 owner=maas
93 group=maas
94 mode=0644
95 with_items:
Charles Chana4ccbde2016-08-02 00:12:34 -070096 - connect-switch.yml
David K. Bainbridge915105d2016-07-06 14:10:08 -070097
98- name: Ensure Dynamic Inventory Script
99 become: yes
100 template:
101 src=files/pod-inventory
102 dest=/etc/maas/ansible/pod-inventory
103 owner=maas
104 group=maas
105 mode=0755