blob: 84b19e240bbd07fd12c3912c2fb60900e3bf6ea0 [file] [log] [blame]
Zack Williams8625d042016-02-26 14:32:43 -07001---
Zack Williams0ab8f512017-06-29 08:41:51 -07002# file: head-prep/tasks/main.yml
Zack Williams8625d042016-02-26 14:32:43 -07003
4- name: Install prerequisites for using PPA repos
5 apt:
Zack Williams5223dd92017-02-28 23:38:02 -07006 name: "{{ item }}"
7 update_cache: yes
8 cache_valid_time: 3600
Zack Williams8625d042016-02-26 14:32:43 -07009 with_items:
10 - python-pycurl
11 - software-properties-common
12
Zack Williams5223dd92017-02-28 23:38:02 -070013- name: Add Ansible PPA
Zack Williams8625d042016-02-26 14:32:43 -070014 apt_repository:
15 repo={{ item }}
16 with_items:
Zack Williams5223dd92017-02-28 23:38:02 -070017 - "{{ ansible_apt_repo | default('ppa:ansible/ansible') }}"
Andy Bavier8cbc1f82017-02-24 16:35:39 -050018 register: result
19 until: result | success
20 retries: 3
21 delay: 10
Zack Williams8625d042016-02-26 14:32:43 -070022
23- name: Install packages
24 apt:
Zack Williams5223dd92017-02-28 23:38:02 -070025 name: "{{ item }}"
26 update_cache: yes
27 cache_valid_time: 3600
Zack Williams8625d042016-02-26 14:32:43 -070028 with_items:
Zack Williams5223dd92017-02-28 23:38:02 -070029 - bridge-utils
30 - dnsutils
Zack Williams8625d042016-02-26 14:32:43 -070031 - git
Zack Williams8625d042016-02-26 14:32:43 -070032 - juju-core
Sapan Bhatia96426ec2017-04-13 19:41:04 -070033 - libssl-dev
Zack Williams5223dd92017-02-28 23:38:02 -070034 - libvirt-bin
Sapan Bhatia96426ec2017-04-13 19:41:04 -070035 - python-dev
Zack Williams5223dd92017-02-28 23:38:02 -070036 - python-glanceclient
37 - python-keystoneclient
38 - python-lxml
39 - python-neutronclient
40 - python-novaclient
41 - python-pip
Sapan Bhatia96426ec2017-04-13 19:41:04 -070042 - sshpass
Zack Williams5223dd92017-02-28 23:38:02 -070043 - virt-top
Zack Williams8625d042016-02-26 14:32:43 -070044
Zack Williams0ab8f512017-06-29 08:41:51 -070045- 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 Williams682450e2016-11-19 09:04:41 -070053
Andy Bavier30d27c92016-09-15 15:59:17 -040054- name: Install Python packages
55 pip:
Zack Williams5223dd92017-02-28 23:38:02 -070056 name: "{{ item }}"
Andy Bavier30d27c92016-09-15 15:59:17 -040057 with_items:
Andy Bavier30d27c92016-09-15 15:59:17 -040058 - ndg-httpsclient
Zack Williams5223dd92017-02-28 23:38:02 -070059 - passlib
Andy Bavier30d27c92016-09-15 15:59:17 -040060 - pyasn1
Zack Williams5223dd92017-02-28 23:38:02 -070061 - pyopenssl
62 - urllib3
63 - gitpython
64 - graphviz
Andy Bavier30d27c92016-09-15 15:59:17 -040065
Zack Williams5223dd92017-02-28 23:38:02 -070066- 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 Williams8625d042016-02-26 14:32:43 -070073
Zack Williams5223dd92017-02-28 23:38:02 -070074- 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 Williams8625d042016-02-26 14:32:43 -070081
Zack Williams5223dd92017-02-28 23:38:02 -070082- 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 Williams8625d042016-02-26 14:32:43 -070089
Zack Williams2cffa0f2016-05-20 12:18:47 -070090- name: Disable host key checking in ~/.ssh/config
91 lineinfile:
Zack Williams5223dd92017-02-28 23:38:02 -070092 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 Williams2cffa0f2016-05-20 12:18:47 -070098
99- name: Disable host key checking in ~/.ansible.cfg
100 copy:
Zack Williams5223dd92017-02-28 23:38:02 -0700101 src: ansible.cfg
102 dest: "{{ ansible_user_dir }}/.ansible.cfg"
103 owner: "{{ ansible_user_id }}"
104 group: "{{ ansible_user_gid }}"
105 mode: 0644
106