David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 1 | - 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. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 8 | mode=0755 |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 9 | |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 10 | - name: Ensure Ansible Roles |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 11 | become: yes |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 12 | 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. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 19 | |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 20 | - name: Ensure Role Permissions and Modes |
David K. Bainbridge | e18f57b | 2016-05-23 15:40:58 -0700 | [diff] [blame] | 21 | become: yes |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 22 | file: |
David K. Bainbridge | 141d2ab | 2016-08-26 13:02:33 -0700 | [diff] [blame] | 23 | path: /etc/maas/ansible/roles |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 24 | owner: maas |
| 25 | group: maas |
| 26 | mode: u=rwX,g=rX,o=rX |
| 27 | state: directory |
| 28 | recurse: true |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 29 | |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 30 | - name: Ensure Ansible Provisioning Script |
| 31 | become: yes |
| 32 | copy: |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 33 | dest=/etc/maas/ansible/{{ item }} |
| 34 | src=files/{{ item }} |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 35 | owner=maas |
| 36 | group=maas |
| 37 | mode=0755 |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 38 | with_items: |
| 39 | - do-ansible |
| 40 | - do-switch |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 41 | |
| 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. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 51 | - 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 Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 57 | - name: Ensure Compute and Switch Node Playbooks |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 58 | become: yes |
David K. Bainbridge | 10b0c11 | 2016-05-24 13:17:23 -0700 | [diff] [blame] | 59 | template: |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 60 | src=files/{{ item }} |
| 61 | dest=/etc/maas/ansible/{{ item }} |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 62 | owner=maas |
| 63 | group=maas |
| 64 | mode=0644 |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 65 | with_items: |
| 66 | - compute-node.yml |
| 67 | - switch-node.yml |
Charles Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 68 | |
David K. Bainbridge | 906a9a1 | 2016-08-25 10:50:45 -0700 | [diff] [blame] | 69 | - 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 Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 87 | - 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 Chan | a4ccbde | 2016-08-02 00:12:34 -0700 | [diff] [blame] | 96 | - connect-switch.yml |
David K. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 97 | |
| 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 |