blob: c3aeb510b15e9d7cb305cb5382d3b94cb7e4d3c1 [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:
David K. Bainbridgea677d4e2016-09-11 20:01:32 -070013 src: "{{ item }}"
David K. Bainbridge5ba01a92016-08-16 14:58:31 -070014 dest: /etc/maas/ansible
15 owner: maas
16 group: maas
17 mode: u=rwX,g=rX,o=rX
18 force: true
David K. Bainbridgea677d4e2016-09-11 20:01:32 -070019 with_items:
20 - roles
21 - library
David K. Bainbridgeed101542016-05-18 20:26:15 -070022
David K. Bainbridge5ba01a92016-08-16 14:58:31 -070023- name: Ensure Role Permissions and Modes
David K. Bainbridgee18f57b2016-05-23 15:40:58 -070024 become: yes
David K. Bainbridge5ba01a92016-08-16 14:58:31 -070025 file:
David K. Bainbridge141d2ab2016-08-26 13:02:33 -070026 path: /etc/maas/ansible/roles
David K. Bainbridge5ba01a92016-08-16 14:58:31 -070027 owner: maas
28 group: maas
29 mode: u=rwX,g=rX,o=rX
30 state: directory
31 recurse: true
David K. Bainbridgeed101542016-05-18 20:26:15 -070032
David K. Bainbridge0820cab2016-06-02 17:43:32 -070033- name: Ensure Ansible Provisioning Script
34 become: yes
35 copy:
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070036 dest=/etc/maas/ansible/{{ item }}
37 src=files/{{ item }}
David K. Bainbridge0820cab2016-06-02 17:43:32 -070038 owner=maas
39 group=maas
40 mode=0755
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070041 with_items:
42 - do-ansible
43 - do-switch
David K. Bainbridge0820cab2016-06-02 17:43:32 -070044
45- name: Ensure Provisioning Log Directory
46 become: yes
47 file:
48 path=/etc/maas/ansible/logs
49 state=directory
50 owner=maas
51 group=maas
52 mode=0755
53
David K. Bainbridge915105d2016-07-06 14:10:08 -070054- name: Capture MAAS API Key
55 become: yes
56 command: maas-region-admin apikey --username={{ maas.user }}
57 register: apikey
58 changed_when: false
59
Charles Chan3c681622016-08-03 21:53:03 -070060- name: Ensure Compute and Switch Node Playbooks
David K. Bainbridgeed101542016-05-18 20:26:15 -070061 become: yes
David K. Bainbridge10b0c112016-05-24 13:17:23 -070062 template:
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070063 src=files/{{ item }}
64 dest=/etc/maas/ansible/{{ item }}
David K. Bainbridgeed101542016-05-18 20:26:15 -070065 owner=maas
66 group=maas
67 mode=0644
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070068 with_items:
69 - compute-node.yml
70 - switch-node.yml
Charles Chan3c681622016-08-03 21:53:03 -070071
David K. Bainbridge906a9a12016-08-25 10:50:45 -070072- name: Ensure Compute and Switch Variable Directory
73 become: yes
74 file:
75 path=/etc/maas/ansible/vars
76 owner=maas
77 group=maas
78 mode=0755
79 state=directory
80
81- name: Ensure Compute and Switch Node Variables
82 become: yes
83 template:
84 src=files/compute-node-vars.yml
David K. Bainbridgea677d4e2016-09-11 20:01:32 -070085 dest=/etc/maas/ansible/vars/compute-node-vars.yml
David K. Bainbridge906a9a12016-08-25 10:50:45 -070086 owner=maas
87 group=maas
88 mode=0644
89
Charles Chan3c681622016-08-03 21:53:03 -070090- name: Ensure Connect Switch Ansible Playbook
91 become: yes
92 copy:
93 dest=/etc/maas/ansible/{{ item }}
94 src=files/{{ item }}
95 owner=maas
96 group=maas
97 mode=0644
98 with_items:
Charles Chana4ccbde2016-08-02 00:12:34 -070099 - connect-switch.yml
David K. Bainbridge915105d2016-07-06 14:10:08 -0700100
101- name: Ensure Dynamic Inventory Script
102 become: yes
103 template:
104 src=files/pod-inventory
105 dest=/etc/maas/ansible/pod-inventory
106 owner=maas
107 group=maas
108 mode=0755