blob: e0505560f91e6b4f2f23ae5000b3757eb7ef1e39 [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
8
9- name: Ensure Ansible Compute Config Files
10 become: yes
11 git:
David K. Bainbridge10b0c112016-05-24 13:17:23 -070012 repo={{ provision.location }}
David K. Bainbridgeed101542016-05-18 20:26:15 -070013 dest=/tmp/ansible.maas
14 clone=yes
15 force=yes
16 update=yes
17
David K. Bainbridgee18f57b2016-05-23 15:40:58 -070018- name: Ensure Ansible Roles Exist
19 become: yes
David K. Bainbridge10b0c112016-05-24 13:17:23 -070020 command: cp -rf /tmp/ansible.maas/{{ provision.role_path }} /etc/maas/ansible
David K. Bainbridgee18f57b2016-05-23 15:40:58 -070021
22- name: Ensure Ansible Roles Ownership
23 become: yes
David K. Bainbridge10b0c112016-05-24 13:17:23 -070024 file: dest=/etc/maas/ansible/{{ provision.role_path }} owner=maas group=maas recurse=yes
David K. Bainbridgeed101542016-05-18 20:26:15 -070025
David K. Bainbridge0820cab2016-06-02 17:43:32 -070026- name: Ensure Ansible Provisioning Script
27 become: yes
28 copy:
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070029 dest=/etc/maas/ansible/{{ item }}
30 src=files/{{ item }}
David K. Bainbridge0820cab2016-06-02 17:43:32 -070031 owner=maas
32 group=maas
33 mode=0755
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070034 with_items:
35 - do-ansible
36 - do-switch
David K. Bainbridge0820cab2016-06-02 17:43:32 -070037
38- name: Ensure Provisioning Log Directory
39 become: yes
40 file:
41 path=/etc/maas/ansible/logs
42 state=directory
43 owner=maas
44 group=maas
45 mode=0755
46
David K. Bainbridge915105d2016-07-06 14:10:08 -070047- name: Capture MAAS API Key
48 become: yes
49 command: maas-region-admin apikey --username={{ maas.user }}
50 register: apikey
51 changed_when: false
52
Charles Chanf35d4b82016-08-02 00:12:34 -070053- name: Ensure Playbooks
David K. Bainbridgeed101542016-05-18 20:26:15 -070054 become: yes
David K. Bainbridge10b0c112016-05-24 13:17:23 -070055 template:
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070056 src=files/{{ item }}
57 dest=/etc/maas/ansible/{{ item }}
David K. Bainbridgeed101542016-05-18 20:26:15 -070058 owner=maas
59 group=maas
60 mode=0644
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070061 with_items:
62 - compute-node.yml
63 - switch-node.yml
Charles Chanf35d4b82016-08-02 00:12:34 -070064 - connect-switch.yml
David K. Bainbridge915105d2016-07-06 14:10:08 -070065
66- name: Ensure Dynamic Inventory Script
67 become: yes
68 template:
69 src=files/pod-inventory
70 dest=/etc/maas/ansible/pod-inventory
71 owner=maas
72 group=maas
73 mode=0755