-
Notifications
You must be signed in to change notification settings - Fork 2
/
ansible.yml
85 lines (68 loc) · 2.15 KB
/
ansible.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
- hosts: '*'
connection: local
become: True
vars:
# my_reinstall_ansible_from_ppa: yes
my_reinstall_ansible_from_ppa: no
my_disable_ansible_host_key_change_check: yes
# my_ansible_additonal_role_path: '/ansible/roles'
my_ansible_additonal_role_path: Null
# my_ansible_nb_parallel_targets: 20
my_ansible_nb_parallel_targets: Null
tasks:
- name: Add Ansible repo
when: my_reinstall_ansible_from_ppa
apt_repository:
repo: deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main
- name: Add Ansible repo key
when: my_reinstall_ansible_from_ppa
apt_key:
id: 93C4A3FD7BB9C367
url: keyserver.ubuntu.com
state: present
- name: Reinstall Ansible from PPA
when: my_reinstall_ansible_from_ppa
apt:
name: ansible
update_cache: yes
- name: Update ansible roles path
when: my_ansible_additonal_role_path
lineinfile:
path: /etc/ansible/ansible.cfg
line: "roles_path = /etc/ansible/roles:{{ my_ansible_additonal_role_path }}"
regexp: '^#?roles_path *='
- name: Disable checking host key changes
when: my_disable_ansible_host_key_change_check
lineinfile:
path: /etc/ansible/ansible.cfg
regexp: '.*host_key_checking = .*'
line: 'host_key_checking = False'
- name: Tweek number of target hosts provisioned in parallel
when: my_ansible_nb_parallel_targets
lineinfile:
path: /etc/ansible/ansible.cfg
regexp: '.*forks = .*'
line: 'forks = {{ my_ansible_nb_parallel_targets }}'
- name: install pip
apt:
name: python3-pip
- name: tell Ansible python interpreter is python3
set_fact:
ansible_python_interpreter: /usr/bin/python3
- name: install standard python modules
pip:
name:
- requests
- configparser
- name: install Ansible module dependencies (pip)
pip:
name:
- pywinrm>=0.3.0
- docker-py
- dnf
- pyrax
- name: install Ansible module dependencies (system)
apt:
name:
- rsync