blob: 1607e5fb5b5110e13200cabf3ab5132d727f187d [file] [log] [blame]
Zack Williams8625d042016-02-26 14:32:43 -07001---
2# file: roles/compute-prep/tasks/main.yml
3
Zack Williams709f11b2016-03-17 14:29:51 -07004- name: Install packages
Zack Williamsb2b8c7b2016-03-10 12:47:18 -07005 apt:
Zack Williams6f5a6e72016-08-10 17:45:27 -07006 name: "{{ item }}"
7 state: present
8 update_cache: yes
9 cache_valid_time: 3600
Zack Williams8625d042016-02-26 14:32:43 -070010 with_items:
11 - python-yaml
12
Andy Bavier3a1d0642016-07-01 14:11:39 -040013- name: Add ubuntu user
14 user:
Zack Williams6f5a6e72016-08-10 17:45:27 -070015 name: ubuntu
16 groups: adm
Andy Bavier3a1d0642016-07-01 14:11:39 -040017
Zack Williamsc047c872017-01-11 08:38:15 -070018- 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 Williams709f11b2016-03-17 14:29:51 -070034- name: Add head node ubuntu user key
35 authorized_key:
Zack Williams6f5a6e72016-08-10 17:45:27 -070036 user: ubuntu
37 key: "{{ hostvars[groups['head'][0]]['sshkey']['stdout'] }}"
Zack Williams709f11b2016-03-17 14:29:51 -070038
Andy Bavier3a1d0642016-07-01 14:11:39 -040039- name: Add head node root user key
40 authorized_key:
Zack Williams6f5a6e72016-08-10 17:45:27 -070041 user: root
42 key: "{{ hostvars[groups['head'][0]]['sshkey']['stdout'] }}"
Andy Bavier3a1d0642016-07-01 14:11:39 -040043
Zack Williams709f11b2016-03-17 14:29:51 -070044- name: Add route via /etc/rc.local
Zack Williams6f5a6e72016-08-10 17:45:27 -070045 when: not on_maas
Zack Williams709f11b2016-03-17 14:29:51 -070046 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 Bavier30d27c92016-09-15 15:59:17 -040057
58- name: Remove superfluous requests package
59 pip:
60 name=requests
61 state=absent
Zack Williams682450e2016-11-19 09:04:41 -070062