Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 1 | --- |
| 2 | # file: roles/compute-prep/tasks/main.yml |
| 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 }}" |
| 7 | state: present |
| 8 | update_cache: yes |
| 9 | cache_valid_time: 3600 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 10 | with_items: |
| 11 | - python-yaml |
| 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 | c047c87 | 2017-01-11 08:38:15 -0700 | [diff] [blame] | 18 | - name: Copy over CA certs |
| 19 | synchronize: |
| 20 | src: "/usr/local/share/ca-certificates/" |
| 21 | dest: "/usr/local/share/ca-certificates/" |
| 22 | notify: |
| 23 | - update-ca-certifictes on compute node |
| 24 | |
| 25 | - name: List certs in /usr/local/share/ca-certificates/ |
| 26 | command: "ls -la /usr/local/share/ca-certificates/" |
| 27 | register: certs_on_compute |
| 28 | tags: |
| 29 | - skip_ansible_lint # diagnostics |
| 30 | |
| 31 | - name: Output from listing certs |
| 32 | debug: var=certs_on_compute |
| 33 | |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 34 | - name: Add head node ubuntu user key |
| 35 | authorized_key: |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 36 | user: ubuntu |
| 37 | key: "{{ hostvars[groups['head'][0]]['sshkey']['stdout'] }}" |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 38 | |
Andy Bavier | 3a1d064 | 2016-07-01 14:11:39 -0400 | [diff] [blame] | 39 | - name: Add head node root user key |
| 40 | authorized_key: |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 41 | user: root |
| 42 | key: "{{ hostvars[groups['head'][0]]['sshkey']['stdout'] }}" |
Andy Bavier | 3a1d064 | 2016-07-01 14:11:39 -0400 | [diff] [blame] | 43 | |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 44 | - name: Add route via /etc/rc.local |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 45 | when: not on_maas |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 46 | template: |
| 47 | src=rc.local.j2 |
| 48 | dest=/etc/rc.local |
| 49 | mode=0755 |
| 50 | notify: |
| 51 | - run rc.local |
| 52 | |
| 53 | - name: Create /var/lib/nova dir |
| 54 | file: |
| 55 | path=/var/lib/nova |
| 56 | state=directory |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 57 | |
| 58 | - name: Remove superfluous requests package |
| 59 | pip: |
| 60 | name=requests |
| 61 | state=absent |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 62 | |