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 | |
David K. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 102 | - name: Ensure Dynamic Inventory Script |
| 103 | become: yes |
| 104 | template: |
Scott Baker | b2b7fd9 | 2016-11-01 16:01:38 -0700 | [diff] [blame] | 105 | src=templates/pod-inventory |
David K. Bainbridge | 915105d | 2016-07-06 14:10:08 -0700 | [diff] [blame] | 106 | dest=/etc/maas/ansible/pod-inventory |
| 107 | owner=maas |
| 108 | group=maas |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 109 | mode="0755" |
David K. Bainbridge | 7ae4f19 | 2016-09-29 09:01:38 -0700 | [diff] [blame] | 110 | |
| 111 | - name: Copy CORD Utility Scripts |
| 112 | become: yes |
| 113 | copy: |
| 114 | src=files/commands/{{ item }} |
| 115 | dest=/usr/local/bin/{{ item }} |
| 116 | owner=root |
| 117 | group=root |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 118 | mode="0755" |
David K. Bainbridge | 7ae4f19 | 2016-09-29 09:01:38 -0700 | [diff] [blame] | 119 | with_items: |
| 120 | - cord |
| 121 | - cord-harvest |
| 122 | - cord-prov |
David K. Bainbridge | 058c3d6 | 2016-09-30 15:03:26 -0700 | [diff] [blame] | 123 | - cord-switch |
| 124 | - cord-generate |
David K. Bainbridge | c4e0fc5 | 2016-11-14 12:03:35 -0800 | [diff] [blame] | 125 | - cord-registry |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 126 | |
| 127 | - name: Ensure SSH Key Storage |
| 128 | become: yes |
| 129 | file: |
| 130 | path: /etc/maas/.ssh |
| 131 | mode: "0755" |
| 132 | owner: maas |
| 133 | group: maas |
| 134 | state: directory |
| 135 | |
| 136 | - name: Copy SSH Key Pair for POD |
| 137 | become: yes |
| 138 | copy: |
David K. Bainbridge | 0a7cdbb | 2017-07-14 11:36:13 -0700 | [diff] [blame] | 139 | src: "{{pub_ssh_key_file_location}}/{{item}}" |
David K. Bainbridge | 8b17904 | 2016-11-30 15:38:42 -0800 | [diff] [blame] | 140 | dest: /etc/maas/.ssh/{{item}} |
| 141 | owner: maas |
| 142 | group: maas |
| 143 | mode: "0644" |
| 144 | with_items: |
| 145 | - cord_rsa |
| 146 | - cord_rsa.pub |