| --- |
| # file: roles/head-prep/tasks/main.yml |
| |
| - name: Install prerequisites for using PPA repos |
| apt: |
| name={{ item }} |
| with_items: |
| - python-pycurl |
| - software-properties-common |
| |
| - name: Add Ansible/Juju repositories |
| apt_repository: |
| repo={{ item }} |
| with_items: |
| - "ppa:juju/stable" |
| - "ppa:ansible/ansible" |
| |
| - name: Install packages |
| apt: |
| name={{ item }} |
| state=latest |
| update_cache=yes |
| with_items: |
| - ansible |
| - uvtool |
| - git |
| - bzr |
| - juju-core |
| - python-novaclient |
| - python-neutronclient |
| - python-keystoneclient |
| - python-glanceclient |
| - virt-top |
| |
| - name: Prep user account by adding to libvirtd group and generating SSH key |
| user: |
| name={{ ansible_user_id }} |
| generate_ssh_key=yes |
| groups="libvirtd" append=yes |
| |
| - name: Register public key in variable |
| shell: cat {{ ansible_user_dir }}/.ssh/id_rsa.pub |
| register: sshkey |
| |
| - name: Add public key to this user account |
| authorized_key: |
| user={{ ansible_user_id }} |
| key="{{ sshkey.stdout }}" |
| |