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: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 6 | name: "{{ item }}" |
| 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-pycurl |
| 11 | - software-properties-common |
| 12 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 13 | - name: Add Ansible PPA |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 14 | apt_repository: |
| 15 | repo={{ item }} |
| 16 | with_items: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 17 | - "{{ ansible_apt_repo | default('ppa:ansible/ansible') }}" |
Andy Bavier | 8cbc1f8 | 2017-02-24 16:35:39 -0500 | [diff] [blame] | 18 | register: result |
| 19 | until: result | success |
| 20 | retries: 3 |
| 21 | delay: 10 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 22 | |
| 23 | - name: Install packages |
| 24 | apt: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 25 | name: "{{ item }}" |
| 26 | update_cache: yes |
| 27 | cache_valid_time: 3600 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 28 | with_items: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 29 | - bridge-utils |
| 30 | - dnsutils |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 31 | - git |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 32 | - juju-core |
Sapan Bhatia | 96426ec | 2017-04-13 19:41:04 -0700 | [diff] [blame] | 33 | - libssl-dev |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 34 | - libvirt-bin |
Sapan Bhatia | 96426ec | 2017-04-13 19:41:04 -0700 | [diff] [blame] | 35 | - python-dev |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 36 | - python-glanceclient |
| 37 | - python-keystoneclient |
| 38 | - python-lxml |
| 39 | - python-neutronclient |
| 40 | - python-novaclient |
| 41 | - python-pip |
Sapan Bhatia | 96426ec | 2017-04-13 19:41:04 -0700 | [diff] [blame] | 42 | - sshpass |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 43 | - virt-top |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 44 | |
Sapan Bhatia | 96426ec | 2017-04-13 19:41:04 -0700 | [diff] [blame] | 45 | - name: Install Ansible via pip |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 46 | pip: name=ansible version=2.2.3.0 |
| 47 | |
Sapan Bhatia | 96426ec | 2017-04-13 19:41:04 -0700 | [diff] [blame] | 48 | # - name: Make sure Ansible is newest version |
| 49 | # apt: |
| 50 | # name: "ansible" |
| 51 | # state: latest |
| 52 | # update_cache: yes |
| 53 | # cache_valid_time: 3600 |
| 54 | # tags: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 55 | # - skip_ansible_lint # ansible-lint complains about latest, need this as distro provided 1.5.x version may be used if already installed. |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 56 | |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 57 | - name: Install Python packages |
| 58 | pip: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 59 | name: "{{ item }}" |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 60 | with_items: |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 61 | - ndg-httpsclient |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 62 | - passlib |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 63 | - pyasn1 |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 64 | - pyopenssl |
| 65 | - urllib3 |
| 66 | - gitpython |
| 67 | - graphviz |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 68 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 69 | - name: Add pod ssh private key to head node user |
| 70 | copy: |
| 71 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey" |
| 72 | dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}" |
| 73 | owner: "{{ ansible_user_id }}" |
| 74 | group: "{{ ansible_user_gid }}" |
| 75 | mode: 0600 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 76 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 77 | - name: Add pod ssh public key to head user |
| 78 | copy: |
| 79 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub" |
| 80 | dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}.pub" |
| 81 | owner: "{{ ansible_user_id }}" |
| 82 | group: "{{ ansible_user_gid }}" |
| 83 | mode: 0644 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 84 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 85 | - name: Add pod ssh signed public key to head node user |
| 86 | copy: |
| 87 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey-cert.pub" |
| 88 | dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}-cert.pub" |
| 89 | owner: "{{ ansible_user_id }}" |
| 90 | group: "{{ ansible_user_gid }}" |
| 91 | mode: 0644 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 92 | |
Zack Williams | 2cffa0f | 2016-05-20 12:18:47 -0700 | [diff] [blame] | 93 | - name: Disable host key checking in ~/.ssh/config |
| 94 | lineinfile: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 95 | dest: "{{ ansible_user_dir }}/.ssh/config" |
| 96 | line: "StrictHostKeyChecking no" |
| 97 | create: yes |
| 98 | owner: "{{ ansible_user_id }}" |
| 99 | group: "{{ ansible_user_gid }}" |
| 100 | mode: 0600 |
Zack Williams | 2cffa0f | 2016-05-20 12:18:47 -0700 | [diff] [blame] | 101 | |
| 102 | - name: Disable host key checking in ~/.ansible.cfg |
| 103 | copy: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 104 | src: ansible.cfg |
| 105 | dest: "{{ ansible_user_dir }}/.ansible.cfg" |
| 106 | owner: "{{ ansible_user_id }}" |
| 107 | group: "{{ ansible_user_gid }}" |
| 108 | mode: 0644 |
| 109 | |