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 | 8b17904 | 2016-11-30 15:38:42 -0800 | [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 | 5b4dafa | 2016-11-22 15:48:19 -0800 | [diff] [blame] | 12 | synchronize: |
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 |
David K. Bainbridge | a677d4e | 2016-09-11 20:01:32 -0700 | [diff] [blame] | 15 | with_items: |
| 16 | - roles |
| 17 | - library |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 18 | |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 19 | - name: Ensure Role Permissions and Modes |
David K. Bainbridge | e18f57b | 2016-05-23 15:40:58 -0700 | [diff] [blame] | 20 | become: yes |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 21 | file: |
David K. Bainbridge | 141d2ab | 2016-08-26 13:02:33 -0700 | [diff] [blame] | 22 | path: /etc/maas/ansible/roles |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 23 | owner: maas |
| 24 | group: maas |
| 25 | mode: u=rwX,g=rX,o=rX |
| 26 | state: directory |
| 27 | recurse: true |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 28 | |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 29 | - name: Ensure Ansible Provisioning Script |
| 30 | become: yes |
| 31 | copy: |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 32 | dest=/etc/maas/ansible/{{ item }} |
| 33 | src=files/{{ item }} |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 34 | owner=maas |
| 35 | group=maas |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 36 | mode="0755" |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 37 | with_items: |
| 38 | - do-ansible |
| 39 | - do-switch |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 40 | |
| 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. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 48 | mode="0755" |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 49 | |
David K. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 50 | - 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 Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 56 | - name: Ensure Compute and Switch Node Playbooks |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 57 | become: yes |
David K. Bainbridge | 10b0c11 | 2016-05-24 13:17:23 -0700 | [diff] [blame] | 58 | template: |
David K. Bainbridge | 96c77e8 | 2016-11-07 14:59:43 -0800 | [diff] [blame] | 59 | src={{ item }}.j2 |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 60 | dest=/etc/maas/ansible/{{ item }} |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 61 | owner=maas |
| 62 | group=maas |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 63 | mode="0644" |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 64 | with_items: |
| 65 | - compute-node.yml |
| 66 | - switch-node.yml |
Charles Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 67 | |
David K. Bainbridge | 906a9a1 | 2016-08-25 10:50:45 -0700 | [diff] [blame] | 68 | - 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. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 74 | mode="0755" |
David K. Bainbridge | 906a9a1 | 2016-08-25 10:50:45 -0700 | [diff] [blame] | 75 | state=directory |
| 76 | |
| 77 | - name: Ensure Compute and Switch Node Variables |
| 78 | become: yes |
| 79 | template: |
Scott Baker | b2b7fd9 | 2016-11-01 16:01:38 -0700 | [diff] [blame] | 80 | src=templates/compute-node-vars.yml.j2 |
David K. Bainbridge | a677d4e | 2016-09-11 20:01:32 -0700 | [diff] [blame] | 81 | dest=/etc/maas/ansible/vars/compute-node-vars.yml |
David K. Bainbridge | 906a9a1 | 2016-08-25 10:50:45 -0700 | [diff] [blame] | 82 | owner=maas |
| 83 | group=maas |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 84 | mode="0644" |
David K. Bainbridge | 906a9a1 | 2016-08-25 10:50:45 -0700 | [diff] [blame] | 85 | |
Charles Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 86 | - 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. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 93 | mode="0644" |
Charles Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 94 | with_items: |
Charles Chan | a4ccbde | 2016-08-02 00:12:34 -0700 | [diff] [blame] | 95 | - connect-switch.yml |
David K. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 96 | |
| 97 | - name: Ensure Dynamic Inventory Script |
| 98 | become: yes |
| 99 | template: |
Scott Baker | b2b7fd9 | 2016-11-01 16:01:38 -0700 | [diff] [blame] | 100 | src=templates/pod-inventory |
David K. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 101 | dest=/etc/maas/ansible/pod-inventory |
| 102 | owner=maas |
| 103 | group=maas |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 104 | mode="0755" |
David K. Bainbridge | 7ae4f19 | 2016-09-29 09:01:38 -0700 | [diff] [blame] | 105 | |
| 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. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 113 | mode="0755" |
David K. Bainbridge | 7ae4f19 | 2016-09-29 09:01:38 -0700 | [diff] [blame] | 114 | with_items: |
| 115 | - cord |
| 116 | - cord-harvest |
| 117 | - cord-prov |
David K. Bainbridge | 058c3d6 | 2016-09-30 15:03:26 -0700 | [diff] [blame] | 118 | - cord-switch |
| 119 | - cord-generate |
David K. Bainbridge | c4e0fc5 | 2016-11-14 12:03:35 -0800 | [diff] [blame] | 120 | - cord-registry |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 121 | |
| 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 |