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: |
David K. Bainbridge | a677d4e | 2016-09-11 20:01:32 -0700 | [diff] [blame] | 13 | src: "{{ item }}" |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 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 | a677d4e | 2016-09-11 20:01:32 -0700 | [diff] [blame] | 19 | with_items: |
| 20 | - roles |
| 21 | - library |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 22 | |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 23 | - name: Ensure Role Permissions and Modes |
David K. Bainbridge | e18f57b | 2016-05-23 15:40:58 -0700 | [diff] [blame] | 24 | become: yes |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 25 | file: |
David K. Bainbridge | 141d2ab | 2016-08-26 13:02:33 -0700 | [diff] [blame] | 26 | path: /etc/maas/ansible/roles |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 27 | owner: maas |
| 28 | group: maas |
| 29 | mode: u=rwX,g=rX,o=rX |
| 30 | state: directory |
| 31 | recurse: true |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 32 | |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 33 | - name: Ensure Ansible Provisioning Script |
| 34 | become: yes |
| 35 | copy: |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 36 | dest=/etc/maas/ansible/{{ item }} |
| 37 | src=files/{{ item }} |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 38 | owner=maas |
| 39 | group=maas |
| 40 | mode=0755 |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 41 | with_items: |
| 42 | - do-ansible |
| 43 | - do-switch |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 44 | |
| 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. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 54 | - 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 Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 60 | - name: Ensure Compute and Switch Node Playbooks |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 61 | become: yes |
David K. Bainbridge | 10b0c11 | 2016-05-24 13:17:23 -0700 | [diff] [blame] | 62 | template: |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 63 | src=files/{{ item }} |
| 64 | dest=/etc/maas/ansible/{{ item }} |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 65 | owner=maas |
| 66 | group=maas |
| 67 | mode=0644 |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 68 | with_items: |
| 69 | - compute-node.yml |
| 70 | - switch-node.yml |
Charles Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 71 | |
David K. Bainbridge | 906a9a1 | 2016-08-25 10:50:45 -0700 | [diff] [blame] | 72 | - 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: |
David K. Bainbridge | ca68f06 | 2016-10-27 11:04:33 -0700 | [diff] [blame] | 84 | src=files/compute-node-vars.yml.j2 |
David K. Bainbridge | a677d4e | 2016-09-11 20:01:32 -0700 | [diff] [blame] | 85 | dest=/etc/maas/ansible/vars/compute-node-vars.yml |
David K. Bainbridge | 906a9a1 | 2016-08-25 10:50:45 -0700 | [diff] [blame] | 86 | owner=maas |
| 87 | group=maas |
| 88 | mode=0644 |
| 89 | |
Charles Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 90 | - 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 Chan | a4ccbde | 2016-08-02 00:12:34 -0700 | [diff] [blame] | 99 | - connect-switch.yml |
David K. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 100 | |
| 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 |
David K. Bainbridge | 7ae4f19 | 2016-09-29 09:01:38 -0700 | [diff] [blame] | 109 | |
| 110 | - name: Copy CORD Utility Scripts |
| 111 | become: yes |
| 112 | copy: |
| 113 | src=files/commands/{{ item }} |
| 114 | dest=/usr/local/bin/{{ item }} |
| 115 | owner=root |
| 116 | group=root |
| 117 | mode=0755 |
| 118 | with_items: |
| 119 | - cord |
| 120 | - cord-harvest |
| 121 | - cord-prov |
David K. Bainbridge | 058c3d6 | 2016-09-30 15:03:26 -0700 | [diff] [blame] | 122 | - cord-switch |
| 123 | - cord-generate |