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