blob: e9254b5cfa40483f3d0aed8aca48a5dd2a555294 [file] [log] [blame]
Matteo Scandolo3896c472017-08-01 13:31:42 -07001
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 Williams8625d042016-02-26 14:32:43 -070017---
Zack Williams0ab8f512017-06-29 08:41:51 -070018# file: head-prep/tasks/main.yml
Zack Williams8625d042016-02-26 14:32:43 -070019
20- name: Install prerequisites for using PPA repos
21 apt:
Zack Williams5223dd92017-02-28 23:38:02 -070022 name: "{{ item }}"
23 update_cache: yes
24 cache_valid_time: 3600
Zack Williams8625d042016-02-26 14:32:43 -070025 with_items:
26 - python-pycurl
27 - software-properties-common
28
Zack Williams5223dd92017-02-28 23:38:02 -070029- name: Add Ansible PPA
Zack Williams8625d042016-02-26 14:32:43 -070030 apt_repository:
31 repo={{ item }}
32 with_items:
Zack Williams5223dd92017-02-28 23:38:02 -070033 - "{{ ansible_apt_repo | default('ppa:ansible/ansible') }}"
Andy Bavier8cbc1f82017-02-24 16:35:39 -050034 register: result
35 until: result | success
36 retries: 3
37 delay: 10
Zack Williams8625d042016-02-26 14:32:43 -070038
39- name: Install packages
40 apt:
Zack Williams5223dd92017-02-28 23:38:02 -070041 name: "{{ item }}"
42 update_cache: yes
43 cache_valid_time: 3600
Zack Williams8625d042016-02-26 14:32:43 -070044 with_items:
Zack Williams5223dd92017-02-28 23:38:02 -070045 - bridge-utils
46 - dnsutils
Zack Williams8625d042016-02-26 14:32:43 -070047 - git
Zack Williams8625d042016-02-26 14:32:43 -070048 - juju-core
Sapan Bhatia96426ec2017-04-13 19:41:04 -070049 - libssl-dev
Zack Williams5223dd92017-02-28 23:38:02 -070050 - libvirt-bin
Sapan Bhatia96426ec2017-04-13 19:41:04 -070051 - python-dev
Zack Williams5223dd92017-02-28 23:38:02 -070052 - python-glanceclient
53 - python-keystoneclient
54 - python-lxml
55 - python-neutronclient
56 - python-novaclient
57 - python-pip
Sapan Bhatia96426ec2017-04-13 19:41:04 -070058 - sshpass
Zack Williams5223dd92017-02-28 23:38:02 -070059 - virt-top
Zack Williams8625d042016-02-26 14:32:43 -070060
Zack Williams0ab8f512017-06-29 08:41:51 -070061- name: Make sure Ansible is newest version
62 apt:
63 name: "ansible"
64 state: latest
65 update_cache: yes
66 cache_valid_time: 3600
67 tags:
68 - skip_ansible_lint # ansible-lint complains about latest, need this as distro provided 1.5.x version may be used if already installed.
Zack Williams682450e2016-11-19 09:04:41 -070069
Andy Bavier30d27c92016-09-15 15:59:17 -040070- name: Install Python packages
71 pip:
Zack Williams5223dd92017-02-28 23:38:02 -070072 name: "{{ item }}"
Andy Bavier30d27c92016-09-15 15:59:17 -040073 with_items:
Andy Bavier30d27c92016-09-15 15:59:17 -040074 - ndg-httpsclient
Zack Williams5223dd92017-02-28 23:38:02 -070075 - passlib
Andy Bavier30d27c92016-09-15 15:59:17 -040076 - pyasn1
Zack Williams5223dd92017-02-28 23:38:02 -070077 - pyopenssl
78 - urllib3
79 - gitpython
80 - graphviz
Andy Bavier30d27c92016-09-15 15:59:17 -040081
Zack Williams5223dd92017-02-28 23:38:02 -070082- name: Add pod ssh private key to head node user
83 copy:
84 src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey"
85 dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}"
86 owner: "{{ ansible_user_id }}"
87 group: "{{ ansible_user_gid }}"
88 mode: 0600
Zack Williams8625d042016-02-26 14:32:43 -070089
Zack Williams5223dd92017-02-28 23:38:02 -070090- name: Add pod ssh public key to head user
91 copy:
92 src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub"
93 dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}.pub"
94 owner: "{{ ansible_user_id }}"
95 group: "{{ ansible_user_gid }}"
96 mode: 0644
Zack Williams8625d042016-02-26 14:32:43 -070097
Zack Williams5223dd92017-02-28 23:38:02 -070098- name: Add pod ssh signed public key to head node user
99 copy:
100 src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey-cert.pub"
101 dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}-cert.pub"
102 owner: "{{ ansible_user_id }}"
103 group: "{{ ansible_user_gid }}"
104 mode: 0644
Zack Williams8625d042016-02-26 14:32:43 -0700105
Zack Williams2cffa0f2016-05-20 12:18:47 -0700106- name: Disable host key checking in ~/.ssh/config
107 lineinfile:
Zack Williams5223dd92017-02-28 23:38:02 -0700108 dest: "{{ ansible_user_dir }}/.ssh/config"
109 line: "StrictHostKeyChecking no"
110 create: yes
111 owner: "{{ ansible_user_id }}"
112 group: "{{ ansible_user_gid }}"
113 mode: 0600
Zack Williams2cffa0f2016-05-20 12:18:47 -0700114
115- name: Disable host key checking in ~/.ansible.cfg
116 copy:
Zack Williams5223dd92017-02-28 23:38:02 -0700117 src: ansible.cfg
118 dest: "{{ ansible_user_dir }}/.ansible.cfg"
119 owner: "{{ ansible_user_id }}"
120 group: "{{ ansible_user_gid }}"
121 mode: 0644
122