Zack Williams | 18b6f02 | 2018-01-19 11:46:54 -0700 | [diff] [blame] | 1 | --- |
Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 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 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 16 | # file: compute-prep/tasks/main.yml |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 17 | |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 18 | - name: Install packages |
Zack Williams | b2b8c7b | 2016-03-10 12:47:18 -0700 | [diff] [blame] | 19 | apt: |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 20 | name: "{{ item }}" |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 21 | update_cache: yes |
| 22 | cache_valid_time: 3600 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 23 | with_items: |
| 24 | - python-yaml |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 25 | - python-pip |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 26 | |
Andy Bavier | 3a1d064 | 2016-07-01 14:11:39 -0400 | [diff] [blame] | 27 | - name: Add ubuntu user |
| 28 | user: |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 29 | name: ubuntu |
| 30 | groups: adm |
Andy Bavier | 3a1d064 | 2016-07-01 14:11:39 -0400 | [diff] [blame] | 31 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 32 | - name: Add pod public key to user accounts |
Zack Williams | fe284a1 | 2017-07-01 11:00:04 -0700 | [diff] [blame] | 33 | when: not use_maas |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 34 | authorized_key: |
| 35 | user: "{{ item }}" |
| 36 | key: "{{ lookup('file', '{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub') }}" |
| 37 | with_items: |
| 38 | - root |
| 39 | - ubuntu |
| 40 | |
| 41 | - name: Add pod public key to user accounts (MaaS) |
Zack Williams | fe284a1 | 2017-07-01 11:00:04 -0700 | [diff] [blame] | 42 | when: use_maas |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 43 | authorized_key: |
| 44 | user: "{{ item }}" |
| 45 | key: "{{ lookup('file', '/opt/cord_profile/node_key.pub') }}" |
| 46 | with_items: |
| 47 | - root |
| 48 | - ubuntu |
| 49 | |
| 50 | - name: Copy over CA certs from head node (MaaS) |
Zack Williams | fe284a1 | 2017-07-01 11:00:04 -0700 | [diff] [blame] | 51 | when: use_maas |
Zack Williams | c047c87 | 2017-01-11 08:38:15 -0700 | [diff] [blame] | 52 | synchronize: |
| 53 | src: "/usr/local/share/ca-certificates/" |
| 54 | dest: "/usr/local/share/ca-certificates/" |
| 55 | notify: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 56 | - update-ca-certificates |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 57 | |
| 58 | - name: Create /var/lib/nova dir |
| 59 | file: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 60 | path: /var/lib/nova |
| 61 | state: directory |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 62 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 63 | - name: Remove requests package which causes SSL errors |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 64 | pip: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 65 | name: "requests" |
| 66 | state: absent |
Zack Williams | 18b6f02 | 2018-01-19 11:46:54 -0700 | [diff] [blame] | 67 | |