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 |
| 8 | |
| 9 | - name: Ensure Ansible Compute Config Files |
| 10 | become: yes |
| 11 | git: |
David K. Bainbridge | 10b0c11 | 2016-05-24 13:17:23 -0700 | [diff] [blame] | 12 | repo={{ provision.location }} |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 13 | dest=/tmp/ansible.maas |
| 14 | clone=yes |
| 15 | force=yes |
| 16 | update=yes |
| 17 | |
David K. Bainbridge | e18f57b | 2016-05-23 15:40:58 -0700 | [diff] [blame] | 18 | - name: Ensure Ansible Roles Exist |
| 19 | become: yes |
David K. Bainbridge | 10b0c11 | 2016-05-24 13:17:23 -0700 | [diff] [blame] | 20 | command: cp -rf /tmp/ansible.maas/{{ provision.role_path }} /etc/maas/ansible |
David K. Bainbridge | e18f57b | 2016-05-23 15:40:58 -0700 | [diff] [blame] | 21 | |
| 22 | - name: Ensure Ansible Roles Ownership |
| 23 | become: yes |
David K. Bainbridge | 10b0c11 | 2016-05-24 13:17:23 -0700 | [diff] [blame] | 24 | file: dest=/etc/maas/ansible/{{ provision.role_path }} owner=maas group=maas recurse=yes |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 25 | |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 26 | - name: Ensure Ansible Provisioning Script |
| 27 | become: yes |
| 28 | copy: |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 29 | dest=/etc/maas/ansible/{{ item }} |
| 30 | src=files/{{ item }} |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 31 | owner=maas |
| 32 | group=maas |
| 33 | mode=0755 |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 34 | with_items: |
| 35 | - do-ansible |
| 36 | - do-switch |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 37 | |
| 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. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 47 | - 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 Chan | 911e75d | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 53 | - name: Ensure Compute and Switch Node Playbooks |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 54 | become: yes |
David K. Bainbridge | 10b0c11 | 2016-05-24 13:17:23 -0700 | [diff] [blame] | 55 | template: |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 56 | src=files/{{ item }} |
| 57 | dest=/etc/maas/ansible/{{ item }} |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 58 | owner=maas |
| 59 | group=maas |
| 60 | mode=0644 |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 61 | with_items: |
| 62 | - compute-node.yml |
| 63 | - switch-node.yml |
Charles Chan | 911e75d | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 64 | |
| 65 | - name: Ensure Connect Switch Ansible Playbook |
| 66 | become: yes |
| 67 | copy: |
| 68 | dest=/etc/maas/ansible/{{ item }} |
| 69 | src=files/{{ item }} |
| 70 | owner=maas |
| 71 | group=maas |
| 72 | mode=0644 |
| 73 | with_items: |
Charles Chan | f35d4b8 | 2016-08-02 00:12:34 -0700 | [diff] [blame] | 74 | - connect-switch.yml |
David K. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 75 | |
| 76 | - name: Ensure Dynamic Inventory Script |
| 77 | become: yes |
| 78 | template: |
| 79 | src=files/pod-inventory |
| 80 | dest=/etc/maas/ansible/pod-inventory |
| 81 | owner=maas |
| 82 | group=maas |
| 83 | mode=0755 |