-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsetup-ansible-control-host.yml
40 lines (35 loc) · 1.1 KB
/
setup-ansible-control-host.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
- name: Install ansible and download my playbooks for system management
hosts: all
tasks:
# Ansible from official repos is ancient - use PPA
- name: add ansible PPA
apt_repository:
repo: ppa:ansible/ansible
codename: "{{ dist_override | default(omit) }}"
filename: ansible
become: yes
- name: install latest Ansible
apt:
name:
- ansible
- python3-pip
state: latest
become: yes
- name: clone ansible-system-setup repository
git:
repo: "{{ github_url }}jan-warchol/ansible-setup"
dest: "{{ ansible_setup_path }}"
version: devel
register: task_result
failed_when:
- task_result is failed
- '"Local modifications exist in repository" not in task_result.msg'
- name: configure git user email
git_config:
key: user.email
value: [email protected]
repo: "{{ ansible_setup_path }}"
- name: install python libraries
pip:
requirements: "{{ ansible_setup_path }}/requirements.txt"
extra_args: --user