summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorRodolfo Carvalho <rhcarvalho@gmail.com>2017-01-12 19:16:03 +0100
committerRodolfo Carvalho <rhcarvalho@gmail.com>2017-01-12 19:16:03 +0100
commitc6febeb11af247f156218542f98f52566cf22931 (patch)
treef35b450a53662fe50065ab832758d5a62ddee9e2 /roles
parentc4aec0fbd112fd1c8503e935ac954da268a2fdff (diff)
downloadopenshift-c6febeb11af247f156218542f98f52566cf22931.tar.gz
openshift-c6febeb11af247f156218542f98f52566cf22931.tar.bz2
openshift-c6febeb11af247f156218542f98f52566cf22931.tar.xz
openshift-c6febeb11af247f156218542f98f52566cf22931.zip
Reduce code duplication using variable
We can use openshift_facts's service_type to determine the package names.
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_preflight/masters/tasks/main.yml29
-rw-r--r--roles/openshift_preflight/nodes/tasks/main.yml29
2 files changed, 14 insertions, 44 deletions
diff --git a/roles/openshift_preflight/masters/tasks/main.yml b/roles/openshift_preflight/masters/tasks/main.yml
index 80d7af208..35fb1e3ca 100644
--- a/roles/openshift_preflight/masters/tasks/main.yml
+++ b/roles/openshift_preflight/masters/tasks/main.yml
@@ -3,33 +3,18 @@
- when: not openshift.common.is_containerized | bool
block:
- - name: main packages for enterprise
- when:
- - deployment_type == "openshift-enterprise"
+ - name: main master packages availability
check_yum_update:
packages:
- - atomic-openshift
- - atomic-openshift-clients
- - atomic-openshift-master
+ - "{{ openshift.common.service_type }}"
+ - "{{ openshift.common.service_type }}-clients"
+ - "{{ openshift.common.service_type }}-master"
register: r
- set_fact:
- oo_preflight_check_results: "{{ oo_preflight_check_results + [r|combine({'_task': 'main packages for enterprise'})] }}"
+ oo_preflight_check_results: "{{ oo_preflight_check_results + [r|combine({'_task': 'main master packages availability'})] }}"
- - name: main packages for origin
- when:
- - deployment_type == "origin"
- check_yum_update:
- packages:
- - origin
- - origin-clients
- - origin-master
- register: r
-
- - set_fact:
- oo_preflight_check_results: "{{ oo_preflight_check_results + [r|combine({'_task': 'main packages for origin'})] }}"
-
- - name: other master packages
+ - name: other master packages availability
check_yum_update:
packages:
- etcd
@@ -43,4 +28,4 @@
register: r
- set_fact:
- oo_preflight_check_results: "{{ oo_preflight_check_results + [r|combine({'_task': 'other master packages'})] }}"
+ oo_preflight_check_results: "{{ oo_preflight_check_results + [r|combine({'_task': 'other master packages availability'})] }}"
diff --git a/roles/openshift_preflight/nodes/tasks/main.yml b/roles/openshift_preflight/nodes/tasks/main.yml
index c98b02bf5..a10e69024 100644
--- a/roles/openshift_preflight/nodes/tasks/main.yml
+++ b/roles/openshift_preflight/nodes/tasks/main.yml
@@ -3,33 +3,18 @@
- when: not openshift.common.is_containerized | bool
block:
- - name: main packages for enterprise
- when:
- - deployment_type == "openshift-enterprise"
+ - name: main node packages availability
check_yum_update:
packages:
- - atomic-openshift
- - atomic-openshift-node
- - atomic-openshift-sdn-ovs
+ - "{{ openshift.common.service_type }}"
+ - "{{ openshift.common.service_type }}-node"
+ - "{{ openshift.common.service_type }}-sdn-ovs"
register: r
- set_fact:
- oo_preflight_check_results: "{{ oo_preflight_check_results + [r|combine({'_task': 'main packages for enterprise'})] }}"
+ oo_preflight_check_results: "{{ oo_preflight_check_results + [r|combine({'_task': 'main node packages availability'})] }}"
- - name: main packages for origin
- when:
- - deployment_type == "origin"
- check_yum_update:
- packages:
- - origin
- - origin-node
- - origin-sdn-ovs
- register: r
-
- - set_fact:
- oo_preflight_check_results: "{{ oo_preflight_check_results + [r|combine({'_task': 'main packages for origin'})] }}"
-
- - name: other node packages
+ - name: other node packages availability
check_yum_update:
packages:
- docker
@@ -53,4 +38,4 @@
register: r
- set_fact:
- oo_preflight_check_results: "{{ oo_preflight_check_results + [r|combine({'_task': 'other node packages'})] }}"
+ oo_preflight_check_results: "{{ oo_preflight_check_results + [r|combine({'_task': 'other node packages availability'})] }}"