summaryrefslogtreecommitdiffstats
path: root/roles/contiv_facts/tasks/main.yml
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2017-03-01 22:17:22 -0500
committerGitHub <noreply@github.com>2017-03-01 22:17:22 -0500
commit2d52f7c89baae452f3012102ac0f22a071f8f4ce (patch)
treefeb36c4dd6e8a04fa14a24d88d36b6dacc0fa213 /roles/contiv_facts/tasks/main.yml
parent4a3e61e035e42a260e0bf59d1e0c891dc004d50d (diff)
parent58818a6af147e457d56a1faf77b02d37bb538826 (diff)
downloadopenshift-2d52f7c89baae452f3012102ac0f22a071f8f4ce.tar.gz
openshift-2d52f7c89baae452f3012102ac0f22a071f8f4ce.tar.bz2
openshift-2d52f7c89baae452f3012102ac0f22a071f8f4ce.tar.xz
openshift-2d52f7c89baae452f3012102ac0f22a071f8f4ce.zip
Merge pull request #3393 from srampal/contiv
Pull request for Contiv Ansible code integration into Openshift Ansible
Diffstat (limited to 'roles/contiv_facts/tasks/main.yml')
-rw-r--r--roles/contiv_facts/tasks/main.yml88
1 files changed, 88 insertions, 0 deletions
diff --git a/roles/contiv_facts/tasks/main.yml b/roles/contiv_facts/tasks/main.yml
new file mode 100644
index 000000000..926e0e0be
--- /dev/null
+++ b/roles/contiv_facts/tasks/main.yml
@@ -0,0 +1,88 @@
+---
+- name: Determine if Atomic
+ stat: path=/run/ostree-booted
+ register: s
+ changed_when: false
+ always_run: yes
+
+- 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
+ always_run: yes
+
+- 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
+ always_run: yes
+
+- 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"