blob: 04a7e8c08683e850a7ad7028ffc4003b577f7822 [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. Bainbridge8b179042016-11-30 15:38:42 -08008 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. Bainbridge5b4dafa2016-11-22 15:48:19 -080012 synchronize:
David K. Bainbridgea677d4e2016-09-11 20:01:32 -070013 src: "{{ item }}"
David K. Bainbridge5ba01a92016-08-16 14:58:31 -070014 dest: /etc/maas/ansible
David K. Bainbridgea677d4e2016-09-11 20:01:32 -070015 with_items:
16 - roles
17 - library
David K. Bainbridgeed101542016-05-18 20:26:15 -070018
David K. Bainbridge5ba01a92016-08-16 14:58:31 -070019- name: Ensure Role Permissions and Modes
David K. Bainbridgee18f57b2016-05-23 15:40:58 -070020 become: yes
David K. Bainbridge5ba01a92016-08-16 14:58:31 -070021 file:
David K. Bainbridge141d2ab2016-08-26 13:02:33 -070022 path: /etc/maas/ansible/roles
David K. Bainbridge5ba01a92016-08-16 14:58:31 -070023 owner: maas
24 group: maas
25 mode: u=rwX,g=rX,o=rX
26 state: directory
27 recurse: true
David K. Bainbridgeed101542016-05-18 20:26:15 -070028
David K. Bainbridge0820cab2016-06-02 17:43:32 -070029- name: Ensure Ansible Provisioning Script
30 become: yes
31 copy:
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070032 dest=/etc/maas/ansible/{{ item }}
33 src=files/{{ item }}
David K. Bainbridge0820cab2016-06-02 17:43:32 -070034 owner=maas
35 group=maas
David K. Bainbridge8b179042016-11-30 15:38:42 -080036 mode="0755"
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070037 with_items:
38 - do-ansible
39 - do-switch
David K. Bainbridge0820cab2016-06-02 17:43:32 -070040
41- name: Ensure Provisioning Log Directory
42 become: yes
43 file:
44 path=/etc/maas/ansible/logs
45 state=directory
46 owner=maas
47 group=maas
David K. Bainbridge8b179042016-11-30 15:38:42 -080048 mode="0755"
David K. Bainbridge0820cab2016-06-02 17:43:32 -070049
David K. Bainbridge915105d2016-07-06 14:10:08 -070050- name: Capture MAAS API Key
51 become: yes
52 command: maas-region-admin apikey --username={{ maas.user }}
53 register: apikey
54 changed_when: false
55
Charles Chan3c681622016-08-03 21:53:03 -070056- name: Ensure Compute and Switch Node Playbooks
David K. Bainbridgeed101542016-05-18 20:26:15 -070057 become: yes
David K. Bainbridge10b0c112016-05-24 13:17:23 -070058 template:
David K. Bainbridge96c77e82016-11-07 14:59:43 -080059 src={{ item }}.j2
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070060 dest=/etc/maas/ansible/{{ item }}
David K. Bainbridgeed101542016-05-18 20:26:15 -070061 owner=maas
62 group=maas
David K. Bainbridge8b179042016-11-30 15:38:42 -080063 mode="0644"
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -070064 with_items:
65 - compute-node.yml
66 - switch-node.yml
Charles Chan3c681622016-08-03 21:53:03 -070067
David K. Bainbridge906a9a12016-08-25 10:50:45 -070068- name: Ensure Compute and Switch Variable Directory
69 become: yes
70 file:
71 path=/etc/maas/ansible/vars
72 owner=maas
73 group=maas
David K. Bainbridge8b179042016-11-30 15:38:42 -080074 mode="0755"
David K. Bainbridge906a9a12016-08-25 10:50:45 -070075 state=directory
76
77- name: Ensure Compute and Switch Node Variables
78 become: yes
79 template:
Scott Bakerb2b7fd92016-11-01 16:01:38 -070080 src=templates/compute-node-vars.yml.j2
David K. Bainbridgea677d4e2016-09-11 20:01:32 -070081 dest=/etc/maas/ansible/vars/compute-node-vars.yml
David K. Bainbridge906a9a12016-08-25 10:50:45 -070082 owner=maas
83 group=maas
David K. Bainbridge8b179042016-11-30 15:38:42 -080084 mode="0644"
David K. Bainbridge906a9a12016-08-25 10:50:45 -070085
Charles Chan3c681622016-08-03 21:53:03 -070086- name: Ensure Connect Switch Ansible Playbook
87 become: yes
88 copy:
89 dest=/etc/maas/ansible/{{ item }}
90 src=files/{{ item }}
91 owner=maas
92 group=maas
David K. Bainbridge8b179042016-11-30 15:38:42 -080093 mode="0644"
Charles Chan3c681622016-08-03 21:53:03 -070094 with_items:
Charles Chana4ccbde2016-08-02 00:12:34 -070095 - connect-switch.yml
David K. Bainbridge915105d2016-07-06 14:10:08 -070096
97- name: Ensure Dynamic Inventory Script
98 become: yes
99 template:
Scott Bakerb2b7fd92016-11-01 16:01:38 -0700100 src=templates/pod-inventory
David K. Bainbridge915105d2016-07-06 14:10:08 -0700101 dest=/etc/maas/ansible/pod-inventory
102 owner=maas
103 group=maas
David K. Bainbridge8b179042016-11-30 15:38:42 -0800104 mode="0755"
David K. Bainbridge7ae4f192016-09-29 09:01:38 -0700105
106- name: Copy CORD Utility Scripts
107 become: yes
108 copy:
109 src=files/commands/{{ item }}
110 dest=/usr/local/bin/{{ item }}
111 owner=root
112 group=root
David K. Bainbridge8b179042016-11-30 15:38:42 -0800113 mode="0755"
David K. Bainbridge7ae4f192016-09-29 09:01:38 -0700114 with_items:
115 - cord
116 - cord-harvest
117 - cord-prov
David K. Bainbridge058c3d62016-09-30 15:03:26 -0700118 - cord-switch
119 - cord-generate
David K. Bainbridgec4e0fc52016-11-14 12:03:35 -0800120 - cord-registry
David K. Bainbridge8b179042016-11-30 15:38:42 -0800121
122- name: Ensure SSH Key Storage
123 become: yes
124 file:
125 path: /etc/maas/.ssh
126 mode: "0755"
127 owner: maas
128 group: maas
129 state: directory
130
131- name: Copy SSH Key Pair for POD
132 become: yes
133 copy:
134 src: /etc/maas/.ssh/{{item}}
135 dest: /etc/maas/.ssh/{{item}}
136 owner: maas
137 group: maas
138 mode: "0644"
139 with_items:
140 - cord_rsa
141 - cord_rsa.pub