Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 1 | --- |
| 2 | # file: roles/head-prep/tasks/main.yml |
| 3 | |
| 4 | - name: Install prerequisites for using PPA repos |
| 5 | apt: |
| 6 | name={{ item }} |
| 7 | with_items: |
| 8 | - python-pycurl |
| 9 | - software-properties-common |
| 10 | |
| 11 | - name: Add Ansible/Juju repositories |
| 12 | apt_repository: |
| 13 | repo={{ item }} |
| 14 | with_items: |
| 15 | - "ppa:juju/stable" |
| 16 | - "ppa:ansible/ansible" |
| 17 | |
| 18 | - name: Install packages |
| 19 | apt: |
| 20 | name={{ item }} |
| 21 | state=latest |
| 22 | update_cache=yes |
| 23 | with_items: |
| 24 | - ansible |
| 25 | - uvtool |
| 26 | - git |
| 27 | - bzr |
| 28 | - juju-core |
| 29 | - python-novaclient |
| 30 | - python-neutronclient |
| 31 | - python-keystoneclient |
| 32 | - python-glanceclient |
Andy Bavier | 9895cf2 | 2016-04-25 15:06:20 -0400 | [diff] [blame] | 33 | - python-netaddr |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 34 | - virt-top |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 35 | |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 36 | - name: Prep user account by adding to libvirtd group and generating SSH key |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 37 | user: |
Zack Williams | 9cdf862 | 2016-02-26 22:42:50 -0700 | [diff] [blame] | 38 | name={{ ansible_user_id }} |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 39 | generate_ssh_key=yes |
| 40 | groups="libvirtd" append=yes |
| 41 | |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 42 | - name: Register public key in variable |
Zack Williams | 9cdf862 | 2016-02-26 22:42:50 -0700 | [diff] [blame] | 43 | shell: cat {{ ansible_user_dir }}/.ssh/id_rsa.pub |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 44 | register: sshkey |
| 45 | |
Zack Williams | 709f11b | 2016-03-17 14:29:51 -0700 | [diff] [blame] | 46 | - name: Add public key to this user account |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 47 | authorized_key: |
Zack Williams | 9cdf862 | 2016-02-26 22:42:50 -0700 | [diff] [blame] | 48 | user={{ ansible_user_id }} |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 49 | key="{{ sshkey.stdout }}" |
| 50 | |