Jonathan Hart | 93956f5 | 2017-08-22 13:12:42 -0700 | [diff] [blame^] | 1 | |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 17 | - name: Ensure MAAS Ansible Config Directory |
| 18 | become: yes |
| 19 | file: |
| 20 | path=/etc/maas/ansible |
| 21 | owner=maas |
| 22 | group=maas |
| 23 | state=directory |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 24 | mode="0755" |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 25 | |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 26 | - name: Ensure Ansible Roles |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 27 | become: yes |
David K. Bainbridge | 5b4dafa | 2016-11-22 15:48:19 -0800 | [diff] [blame] | 28 | synchronize: |
David K. Bainbridge | a677d4e | 2016-09-11 20:01:32 -0700 | [diff] [blame] | 29 | src: "{{ item }}" |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 30 | dest: /etc/maas/ansible |
David K. Bainbridge | a677d4e | 2016-09-11 20:01:32 -0700 | [diff] [blame] | 31 | with_items: |
| 32 | - roles |
| 33 | - library |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 34 | |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 35 | - name: Ensure Role Permissions and Modes |
David K. Bainbridge | e18f57b | 2016-05-23 15:40:58 -0700 | [diff] [blame] | 36 | become: yes |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 37 | file: |
David K. Bainbridge | 141d2ab | 2016-08-26 13:02:33 -0700 | [diff] [blame] | 38 | path: /etc/maas/ansible/roles |
David K. Bainbridge | 5ba01a9 | 2016-08-16 14:58:31 -0700 | [diff] [blame] | 39 | owner: maas |
| 40 | group: maas |
| 41 | mode: u=rwX,g=rX,o=rX |
| 42 | state: directory |
| 43 | recurse: true |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 44 | |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 45 | - name: Ensure Ansible Provisioning Script |
| 46 | become: yes |
| 47 | copy: |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 48 | dest=/etc/maas/ansible/{{ item }} |
| 49 | src=files/{{ item }} |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 50 | owner=maas |
| 51 | group=maas |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 52 | mode="0755" |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 53 | with_items: |
| 54 | - do-ansible |
| 55 | - do-switch |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 56 | |
| 57 | - name: Ensure Provisioning Log Directory |
| 58 | become: yes |
| 59 | file: |
| 60 | path=/etc/maas/ansible/logs |
| 61 | state=directory |
| 62 | owner=maas |
| 63 | group=maas |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 64 | mode="0755" |
David K. Bainbridge | 0820cab | 2016-06-02 17:43:32 -0700 | [diff] [blame] | 65 | |
David K. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 66 | - name: Capture MAAS API Key |
| 67 | become: yes |
| 68 | command: maas-region-admin apikey --username={{ maas.user }} |
| 69 | register: apikey |
| 70 | changed_when: false |
| 71 | |
Charles Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 72 | - name: Ensure Compute and Switch Node Playbooks |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 73 | become: yes |
David K. Bainbridge | 10b0c11 | 2016-05-24 13:17:23 -0700 | [diff] [blame] | 74 | template: |
David K. Bainbridge | 96c77e8 | 2016-11-07 14:59:43 -0800 | [diff] [blame] | 75 | src={{ item }}.j2 |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 76 | dest=/etc/maas/ansible/{{ item }} |
David K. Bainbridge | ed10154 | 2016-05-18 20:26:15 -0700 | [diff] [blame] | 77 | owner=maas |
| 78 | group=maas |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 79 | mode="0644" |
David K. Bainbridge | be58a0d | 2016-06-22 15:43:02 -0700 | [diff] [blame] | 80 | with_items: |
| 81 | - compute-node.yml |
| 82 | - switch-node.yml |
Charles Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 83 | |
David K. Bainbridge | 906a9a1 | 2016-08-25 10:50:45 -0700 | [diff] [blame] | 84 | - name: Ensure Compute and Switch Variable Directory |
| 85 | become: yes |
| 86 | file: |
| 87 | path=/etc/maas/ansible/vars |
| 88 | owner=maas |
| 89 | group=maas |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 90 | mode="0755" |
David K. Bainbridge | 906a9a1 | 2016-08-25 10:50:45 -0700 | [diff] [blame] | 91 | state=directory |
| 92 | |
| 93 | - name: Ensure Compute and Switch Node Variables |
| 94 | become: yes |
| 95 | template: |
Scott Baker | b2b7fd9 | 2016-11-01 16:01:38 -0700 | [diff] [blame] | 96 | src=templates/compute-node-vars.yml.j2 |
David K. Bainbridge | a677d4e | 2016-09-11 20:01:32 -0700 | [diff] [blame] | 97 | dest=/etc/maas/ansible/vars/compute-node-vars.yml |
David K. Bainbridge | 906a9a1 | 2016-08-25 10:50:45 -0700 | [diff] [blame] | 98 | owner=maas |
| 99 | group=maas |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 100 | mode="0644" |
David K. Bainbridge | 906a9a1 | 2016-08-25 10:50:45 -0700 | [diff] [blame] | 101 | |
Charles Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 102 | - name: Ensure Connect Switch Ansible Playbook |
| 103 | become: yes |
| 104 | copy: |
| 105 | dest=/etc/maas/ansible/{{ item }} |
| 106 | src=files/{{ item }} |
| 107 | owner=maas |
| 108 | group=maas |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 109 | mode="0644" |
Charles Chan | 3c68162 | 2016-08-03 21:53:03 -0700 | [diff] [blame] | 110 | with_items: |
Charles Chan | a4ccbde | 2016-08-02 00:12:34 -0700 | [diff] [blame] | 111 | - connect-switch.yml |
David K. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 112 | |
| 113 | - name: Ensure Dynamic Inventory Script |
| 114 | become: yes |
| 115 | template: |
Scott Baker | b2b7fd9 | 2016-11-01 16:01:38 -0700 | [diff] [blame] | 116 | src=templates/pod-inventory |
David K. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 117 | dest=/etc/maas/ansible/pod-inventory |
| 118 | owner=maas |
| 119 | group=maas |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 120 | mode="0755" |
David K. Bainbridge | 7ae4f19 | 2016-09-29 09:01:38 -0700 | [diff] [blame] | 121 | |
| 122 | - name: Copy CORD Utility Scripts |
| 123 | become: yes |
| 124 | copy: |
| 125 | src=files/commands/{{ item }} |
| 126 | dest=/usr/local/bin/{{ item }} |
| 127 | owner=root |
| 128 | group=root |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 129 | mode="0755" |
David K. Bainbridge | 7ae4f19 | 2016-09-29 09:01:38 -0700 | [diff] [blame] | 130 | with_items: |
| 131 | - cord |
| 132 | - cord-harvest |
| 133 | - cord-prov |
David K. Bainbridge | 058c3d6 | 2016-09-30 15:03:26 -0700 | [diff] [blame] | 134 | - cord-switch |
| 135 | - cord-generate |
David K. Bainbridge | c4e0fc5 | 2016-11-14 12:03:35 -0800 | [diff] [blame] | 136 | - cord-registry |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 137 | |
| 138 | - name: Ensure SSH Key Storage |
| 139 | become: yes |
| 140 | file: |
| 141 | path: /etc/maas/.ssh |
| 142 | mode: "0755" |
| 143 | owner: maas |
| 144 | group: maas |
| 145 | state: directory |
| 146 | |
| 147 | - name: Copy SSH Key Pair for POD |
| 148 | become: yes |
| 149 | copy: |
David K. Bainbridge | 0a7cdbb | 2017-07-14 11:36:13 -0700 | [diff] [blame] | 150 | src: "{{pub_ssh_key_file_location}}/{{item}}" |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 151 | dest: /etc/maas/.ssh/{{item}} |
| 152 | owner: maas |
| 153 | group: maas |
| 154 | mode: "0644" |
| 155 | with_items: |
| 156 | - cord_rsa |
| 157 | - cord_rsa.pub |