Zack Williams | ecdc89d | 2018-01-22 17:02:33 -0700 | [diff] [blame] | 1 | --- |
Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
Zack Williams | 0ab8f51 | 2017-06-29 08:41:51 -0700 | [diff] [blame] | 16 | # file: head-prep/tasks/main.yml |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 17 | |
| 18 | - name: Install prerequisites for using PPA repos |
| 19 | apt: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 20 | name: "{{ item }}" |
| 21 | update_cache: yes |
| 22 | cache_valid_time: 3600 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 23 | with_items: |
| 24 | - python-pycurl |
| 25 | - software-properties-common |
| 26 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 27 | - name: Add Ansible PPA |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 28 | apt_repository: |
| 29 | repo={{ item }} |
| 30 | with_items: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 31 | - "{{ ansible_apt_repo | default('ppa:ansible/ansible') }}" |
Andy Bavier | 8cbc1f8 | 2017-02-24 16:35:39 -0500 | [diff] [blame] | 32 | register: result |
| 33 | until: result | success |
| 34 | retries: 3 |
| 35 | delay: 10 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 36 | |
| 37 | - name: Install packages |
| 38 | apt: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 39 | name: "{{ item }}" |
| 40 | update_cache: yes |
| 41 | cache_valid_time: 3600 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 42 | with_items: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 43 | - bridge-utils |
| 44 | - dnsutils |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 45 | - git |
Sapan Bhatia | 96426ec | 2017-04-13 19:41:04 -0700 | [diff] [blame] | 46 | - libssl-dev |
| 47 | - python-dev |
Zack Williams | d7b8ffb | 2017-09-27 15:13:17 -0700 | [diff] [blame] | 48 | - python-dnspython |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 49 | - python-lxml |
Zack Williams | d7b8ffb | 2017-09-27 15:13:17 -0700 | [diff] [blame] | 50 | - python-netaddr |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 51 | - python-pip |
Sapan Bhatia | 96426ec | 2017-04-13 19:41:04 -0700 | [diff] [blame] | 52 | - sshpass |
Zack Williams | ecdc89d | 2018-01-22 17:02:33 -0700 | [diff] [blame] | 53 | |
| 54 | - name: Install juju and openstack related packages |
| 55 | when: use_openstack |
| 56 | apt: |
| 57 | name: "{{ item }}" |
| 58 | update_cache: yes |
| 59 | cache_valid_time: 3600 |
| 60 | with_items: |
| 61 | - juju-core |
| 62 | - libvirt-bin |
| 63 | - python-glanceclient |
| 64 | - python-keystoneclient |
| 65 | - python-neutronclient |
| 66 | - python-novaclient |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 67 | - virt-top |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 68 | |
Zack Williams | 0ab8f51 | 2017-06-29 08:41:51 -0700 | [diff] [blame] | 69 | - name: Make sure Ansible is newest version |
| 70 | apt: |
| 71 | name: "ansible" |
| 72 | state: latest |
| 73 | update_cache: yes |
| 74 | cache_valid_time: 3600 |
| 75 | tags: |
| 76 | - 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] | 77 | |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 78 | - name: Install Python packages |
| 79 | pip: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 80 | name: "{{ item }}" |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 81 | with_items: |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 82 | - ndg-httpsclient |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 83 | - passlib |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 84 | - pyasn1 |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 85 | - pyopenssl |
| 86 | - urllib3 |
| 87 | - gitpython |
| 88 | - graphviz |
Andy Bavier | 30d27c9 | 2016-09-15 15:59:17 -0400 | [diff] [blame] | 89 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 90 | - name: Add pod ssh private key to head node user |
| 91 | copy: |
| 92 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey" |
| 93 | dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}" |
| 94 | owner: "{{ ansible_user_id }}" |
| 95 | group: "{{ ansible_user_gid }}" |
| 96 | mode: 0600 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 97 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 98 | - name: Add pod ssh public key to head user |
| 99 | copy: |
| 100 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub" |
| 101 | dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}.pub" |
| 102 | owner: "{{ ansible_user_id }}" |
| 103 | group: "{{ ansible_user_gid }}" |
| 104 | mode: 0644 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 105 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 106 | - name: Add pod ssh signed public key to head node user |
| 107 | copy: |
| 108 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey-cert.pub" |
| 109 | dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}-cert.pub" |
| 110 | owner: "{{ ansible_user_id }}" |
| 111 | group: "{{ ansible_user_gid }}" |
| 112 | mode: 0644 |
Zack Williams | 8625d04 | 2016-02-26 14:32:43 -0700 | [diff] [blame] | 113 | |
Zack Williams | 2cffa0f | 2016-05-20 12:18:47 -0700 | [diff] [blame] | 114 | - name: Disable host key checking in ~/.ssh/config |
| 115 | lineinfile: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 116 | dest: "{{ ansible_user_dir }}/.ssh/config" |
| 117 | line: "StrictHostKeyChecking no" |
| 118 | create: yes |
| 119 | owner: "{{ ansible_user_id }}" |
| 120 | group: "{{ ansible_user_gid }}" |
| 121 | mode: 0600 |
Zack Williams | 2cffa0f | 2016-05-20 12:18:47 -0700 | [diff] [blame] | 122 | |
| 123 | - name: Disable host key checking in ~/.ansible.cfg |
| 124 | copy: |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 125 | src: ansible.cfg |
| 126 | dest: "{{ ansible_user_dir }}/.ansible.cfg" |
| 127 | owner: "{{ ansible_user_id }}" |
| 128 | group: "{{ ansible_user_gid }}" |
| 129 | mode: 0644 |
| 130 | |