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