blob: 2a63cddf011cea7e3ee6509932673d13b669e3ef [file] [log] [blame]
Zack Williams8625d042016-02-26 14:32:43 -07001---
2# file: roles/head-prep/tasks/main.yml
3
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
Sapan Bhatia96426ec2017-04-13 19:41:04 -070045- name: Install Ansible via pip
Zack Williams5223dd92017-02-28 23:38:02 -070046 pip: name=ansible version=2.2.3.0
47
Sapan Bhatia96426ec2017-04-13 19:41:04 -070048# - name: Make sure Ansible is newest version
49# apt:
50# name: "ansible"
51# state: latest
52# update_cache: yes
53# cache_valid_time: 3600
54# tags:
Zack Williams5223dd92017-02-28 23:38:02 -070055# - 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 -070056
Andy Bavier30d27c92016-09-15 15:59:17 -040057- name: Install Python packages
58 pip:
Zack Williams5223dd92017-02-28 23:38:02 -070059 name: "{{ item }}"
Andy Bavier30d27c92016-09-15 15:59:17 -040060 with_items:
Andy Bavier30d27c92016-09-15 15:59:17 -040061 - ndg-httpsclient
Zack Williams5223dd92017-02-28 23:38:02 -070062 - passlib
Andy Bavier30d27c92016-09-15 15:59:17 -040063 - pyasn1
Zack Williams5223dd92017-02-28 23:38:02 -070064 - pyopenssl
65 - urllib3
66 - gitpython
67 - graphviz
Andy Bavier30d27c92016-09-15 15:59:17 -040068
Zack Williams5223dd92017-02-28 23:38:02 -070069- name: Add pod ssh private key to head node user
70 copy:
71 src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey"
72 dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}"
73 owner: "{{ ansible_user_id }}"
74 group: "{{ ansible_user_gid }}"
75 mode: 0600
Zack Williams8625d042016-02-26 14:32:43 -070076
Zack Williams5223dd92017-02-28 23:38:02 -070077- name: Add pod ssh public key to head user
78 copy:
79 src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub"
80 dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}.pub"
81 owner: "{{ ansible_user_id }}"
82 group: "{{ ansible_user_gid }}"
83 mode: 0644
Zack Williams8625d042016-02-26 14:32:43 -070084
Zack Williams5223dd92017-02-28 23:38:02 -070085- name: Add pod ssh signed public key to head node user
86 copy:
87 src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey-cert.pub"
88 dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}-cert.pub"
89 owner: "{{ ansible_user_id }}"
90 group: "{{ ansible_user_gid }}"
91 mode: 0644
Zack Williams8625d042016-02-26 14:32:43 -070092
Zack Williams2cffa0f2016-05-20 12:18:47 -070093- name: Disable host key checking in ~/.ssh/config
94 lineinfile:
Zack Williams5223dd92017-02-28 23:38:02 -070095 dest: "{{ ansible_user_dir }}/.ssh/config"
96 line: "StrictHostKeyChecking no"
97 create: yes
98 owner: "{{ ansible_user_id }}"
99 group: "{{ ansible_user_gid }}"
100 mode: 0600
Zack Williams2cffa0f2016-05-20 12:18:47 -0700101
102- name: Disable host key checking in ~/.ansible.cfg
103 copy:
Zack Williams5223dd92017-02-28 23:38:02 -0700104 src: ansible.cfg
105 dest: "{{ ansible_user_dir }}/.ansible.cfg"
106 owner: "{{ ansible_user_id }}"
107 group: "{{ ansible_user_gid }}"
108 mode: 0644
109