summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Butcher <abutcher@afrolegs.com>2016-07-20 19:05:06 -0400
committerGitHub <noreply@github.com>2016-07-20 19:05:06 -0400
commitd365ed2df542efa9cfa96fb468761cf2242ce8e5 (patch)
tree63544d7986e9f14f43f78bff6262197d6ac50a26
parentc257b47a9138eff4e384218a8eef23f9bfeb701f (diff)
parentc3c88fb35f8f8541b066b6a25f976e53b1813d1d (diff)
downloadopenshift-d365ed2df542efa9cfa96fb468761cf2242ce8e5.tar.gz
openshift-d365ed2df542efa9cfa96fb468761cf2242ce8e5.tar.bz2
openshift-d365ed2df542efa9cfa96fb468761cf2242ce8e5.tar.xz
openshift-d365ed2df542efa9cfa96fb468761cf2242ce8e5.zip
Merge pull request #2189 from abutcher/ansible-version-check
Check ansible version prior to evaluating cluster hosts and groups.
-rw-r--r--playbooks/aws/openshift-cluster/config.yml3
-rw-r--r--playbooks/byo/openshift-cluster/config.yml2
-rw-r--r--playbooks/byo/openshift-cluster/upgrades/v3_2/upgrade.yml2
-rw-r--r--playbooks/byo/openshift_facts.yml2
-rw-r--r--playbooks/common/openshift-cluster/verify_ansible_version.yml10
-rw-r--r--playbooks/libvirt/openshift-cluster/config.yml3
-rw-r--r--playbooks/openstack/openshift-cluster/config.yml2
-rw-r--r--roles/openshift_facts/tasks/main.yml5
8 files changed, 24 insertions, 5 deletions
diff --git a/playbooks/aws/openshift-cluster/config.yml b/playbooks/aws/openshift-cluster/config.yml
index d6b5700b0..647c72239 100644
--- a/playbooks/aws/openshift-cluster/config.yml
+++ b/playbooks/aws/openshift-cluster/config.yml
@@ -1,3 +1,6 @@
+---
+- include: ../../common/openshift-cluster/verify_ansible_version.yml
+
- hosts: localhost
gather_facts: no
tasks:
diff --git a/playbooks/byo/openshift-cluster/config.yml b/playbooks/byo/openshift-cluster/config.yml
index 3477b2dc4..0a931fbe0 100644
--- a/playbooks/byo/openshift-cluster/config.yml
+++ b/playbooks/byo/openshift-cluster/config.yml
@@ -1,4 +1,6 @@
---
+- include: ../../common/openshift-cluster/verify_ansible_version.yml
+
- hosts: localhost
connection: local
become: no
diff --git a/playbooks/byo/openshift-cluster/upgrades/v3_2/upgrade.yml b/playbooks/byo/openshift-cluster/upgrades/v3_2/upgrade.yml
index 8c89e118e..ddb5ef911 100644
--- a/playbooks/byo/openshift-cluster/upgrades/v3_2/upgrade.yml
+++ b/playbooks/byo/openshift-cluster/upgrades/v3_2/upgrade.yml
@@ -1,4 +1,6 @@
---
+- include: ../../common/openshift-cluster/verify_ansible_version.yml
+
- hosts: localhost
connection: local
become: no
diff --git a/playbooks/byo/openshift_facts.yml b/playbooks/byo/openshift_facts.yml
index db8703db6..d966b58fd 100644
--- a/playbooks/byo/openshift_facts.yml
+++ b/playbooks/byo/openshift_facts.yml
@@ -1,4 +1,6 @@
---
+- include: ../common/openshift-cluster/verify_ansible_version.yml
+
- hosts: localhost
connection: local
become: no
diff --git a/playbooks/common/openshift-cluster/verify_ansible_version.yml b/playbooks/common/openshift-cluster/verify_ansible_version.yml
new file mode 100644
index 000000000..2a143b065
--- /dev/null
+++ b/playbooks/common/openshift-cluster/verify_ansible_version.yml
@@ -0,0 +1,10 @@
+---
+- hosts: localhost
+ connection: local
+ become: no
+ gather_facts: no
+ tasks:
+ - name: Verify Ansible version is greater than or equal to 2.1.0.0
+ fail:
+ msg: "Unsupported ansible version: {{ ansible_version.full }} found"
+ when: not ansible_version.full | version_compare('2.1.0.0', 'ge')
diff --git a/playbooks/libvirt/openshift-cluster/config.yml b/playbooks/libvirt/openshift-cluster/config.yml
index a28e59a87..299325fc4 100644
--- a/playbooks/libvirt/openshift-cluster/config.yml
+++ b/playbooks/libvirt/openshift-cluster/config.yml
@@ -2,6 +2,9 @@
# TODO: need to figure out a plan for setting hostname, currently the default
# is localhost, so no hostname value (or public_hostname) value is getting
# assigned
+
+- include: ../../common/openshift-cluster/verify_ansible_version.yml
+
- hosts: localhost
gather_facts: no
tasks:
diff --git a/playbooks/openstack/openshift-cluster/config.yml b/playbooks/openstack/openshift-cluster/config.yml
index 1366c83ca..f6550b2c4 100644
--- a/playbooks/openstack/openshift-cluster/config.yml
+++ b/playbooks/openstack/openshift-cluster/config.yml
@@ -1,4 +1,6 @@
---
+- include: ../../common/openshift-cluster/verify_ansible_version.yml
+
- hosts: localhost
gather_facts: no
tasks:
diff --git a/roles/openshift_facts/tasks/main.yml b/roles/openshift_facts/tasks/main.yml
index 2aca35ce1..4dbbd7f45 100644
--- a/roles/openshift_facts/tasks/main.yml
+++ b/roles/openshift_facts/tasks/main.yml
@@ -1,9 +1,4 @@
---
-- name: Verify Ansible version is greater than or equal to 2.1.0.0
- fail:
- msg: "Unsupported ansible version: {{ ansible_version.full }} found"
- when: not ansible_version.full | version_compare('2.1.0.0', 'ge')
-
- name: Detecting Operating System
stat:
path: /run/ostree-booted