Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 1 | --- |
Zack Williams | 0ab8f51 | 2017-06-29 08:41:51 -0700 | [diff] [blame] | 2 | # file: head-prep/tasks/main.yml |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 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 | |
Zack Williams | 0ab8f51 | 2017-06-29 08:41:51 -0700 | [diff] [blame] | 45 | - name: Make sure Ansible is newest version |
| 46 | apt: |
| 47 | name: "ansible" |
| 48 | state: latest |
| 49 | update_cache: yes |
| 50 | cache_valid_time: 3600 |
| 51 | tags: |
| 52 | - 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] | 53 | |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 54 | - name: Install Python packages |
| 55 | pip: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 56 | name: "{{ item }}" |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 57 | with_items: |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 58 | - ndg-httpsclient |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 59 | - passlib |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 60 | - pyasn1 |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 61 | - pyopenssl |
| 62 | - urllib3 |
| 63 | - gitpython |
| 64 | - graphviz |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 65 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 66 | - name: Add pod ssh private key to head node user |
| 67 | copy: |
| 68 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey" |
| 69 | dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}" |
| 70 | owner: "{{ ansible_user_id }}" |
| 71 | group: "{{ ansible_user_gid }}" |
| 72 | mode: 0600 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 73 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 74 | - name: Add pod ssh public key to head user |
| 75 | copy: |
| 76 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub" |
| 77 | dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}.pub" |
| 78 | owner: "{{ ansible_user_id }}" |
| 79 | group: "{{ ansible_user_gid }}" |
| 80 | mode: 0644 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 81 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 82 | - name: Add pod ssh signed public key to head node user |
| 83 | copy: |
| 84 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey-cert.pub" |
| 85 | dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}-cert.pub" |
| 86 | owner: "{{ ansible_user_id }}" |
| 87 | group: "{{ ansible_user_gid }}" |
| 88 | mode: 0644 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 89 | |
Zack Williams | 2cffa0f | 2016-05-20 12:18:47 -0700 | [diff] [blame] | 90 | - name: Disable host key checking in ~/.ssh/config |
| 91 | lineinfile: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 92 | dest: "{{ ansible_user_dir }}/.ssh/config" |
| 93 | line: "StrictHostKeyChecking no" |
| 94 | create: yes |
| 95 | owner: "{{ ansible_user_id }}" |
| 96 | group: "{{ ansible_user_gid }}" |
| 97 | mode: 0600 |
Zack Williams | 2cffa0f | 2016-05-20 12:18:47 -0700 | [diff] [blame] | 98 | |
| 99 | - name: Disable host key checking in ~/.ansible.cfg |
| 100 | copy: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 101 | src: ansible.cfg |
| 102 | dest: "{{ ansible_user_dir }}/.ansible.cfg" |
| 103 | owner: "{{ ansible_user_id }}" |
| 104 | group: "{{ ansible_user_gid }}" |
| 105 | mode: 0644 |
| 106 | |