blob: 7a4972fca3e1ef84fc9573ae5232d0d9e8fab675 (
plain)
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
86
87
88
|
---
- name: Determine if Atomic
stat: path=/run/ostree-booted
register: s
changed_when: false
check_mode: no
- name: Init the is_atomic fact
set_fact:
is_atomic: false
- name: Set the is_atomic fact
set_fact:
is_atomic: true
when: s.stat.exists
- name: Determine if CoreOS
raw: "grep '^NAME=' /etc/os-release | sed s'/NAME=//'"
register: distro
check_mode: no
- name: Init the is_coreos fact
set_fact:
is_coreos: false
- name: Set the is_coreos fact
set_fact:
is_coreos: true
when: "'CoreOS' in distro.stdout"
- name: Set docker config file directory
set_fact:
docker_config_dir: "/etc/sysconfig"
- name: Override docker config file directory for Debian
set_fact:
docker_config_dir: "/etc/default"
when: ansible_distribution == "Debian" or ansible_distribution == "Ubuntu"
- name: Create config file directory
file:
path: "{{ docker_config_dir }}"
state: directory
- name: Set the bin directory path for CoreOS
set_fact:
bin_dir: "/opt/bin"
when: is_coreos
- name: Create the directory used to store binaries
file:
path: "{{ bin_dir }}"
state: directory
- name: Create Ansible temp directory
file:
path: "{{ ansible_temp_dir }}"
state: directory
- name: Determine if has rpm
stat: path=/usr/bin/rpm
register: s
changed_when: false
check_mode: no
- name: Init the has_rpm fact
set_fact:
has_rpm: false
- name: Set the has_rpm fact
set_fact:
has_rpm: true
when: s.stat.exists
- name: Init the has_firewalld fact
set_fact:
has_firewalld: false
- name: Init the has_iptables fact
set_fact:
has_iptables: false
# collect information about what packages are installed
- include: rpm.yml
when: has_rpm
- include: fedora-install.yml
when: not is_atomic and ansible_distribution == "Fedora"
|