summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2017-02-15 12:19:54 -0500
committerGitHub <noreply@github.com>2017-02-15 12:19:54 -0500
commit34f13cb87db9e18285281d7ec48c7d116f99a1fb (patch)
tree205eb2a4977b020fdd8f6df5ae55bfb0e36f663a
parent67b714641c9d813290712f6b0cbd176432ca3225 (diff)
parent4e9a9d0e3da2b9b74a7bf69110af42f1f276dffe (diff)
downloadopenshift-34f13cb87db9e18285281d7ec48c7d116f99a1fb.tar.gz
openshift-34f13cb87db9e18285281d7ec48c7d116f99a1fb.tar.bz2
openshift-34f13cb87db9e18285281d7ec48c7d116f99a1fb.tar.xz
openshift-34f13cb87db9e18285281d7ec48c7d116f99a1fb.zip
Merge pull request #3364 from detiber/lintCleanup
Ansible Lint cleanup and making filter/lookup plugins used by openshift_master_facts available within the role
-rw-r--r--roles/openshift_facts/tasks/main.yml6
l---------roles/openshift_master_facts/filter_plugins/oo_filters.py1
-rw-r--r--roles/openshift_master_facts/filter_plugins/openshift_master.py (renamed from filter_plugins/openshift_master.py)0
l---------roles/openshift_master_facts/lookup_plugins/oo_option.py1
-rw-r--r--roles/openshift_master_facts/tasks/main.yml18
5 files changed, 18 insertions, 8 deletions
diff --git a/roles/openshift_facts/tasks/main.yml b/roles/openshift_facts/tasks/main.yml
index 11bd68207..7eb879140 100644
--- a/roles/openshift_facts/tasks/main.yml
+++ b/roles/openshift_facts/tasks/main.yml
@@ -6,9 +6,11 @@
register: ostree_booted
# Locally setup containerized facts for now
- - set_fact:
+ - name: Set l_is_atomic
+ set_fact:
l_is_atomic: "{{ ostree_booted.stat.exists }}"
- - set_fact:
+ - name: Set other local variables
+ set_fact:
l_is_containerized: "{{ (l_is_atomic | bool) or (containerized | default(false) | bool) }}"
l_is_openvswitch_system_container: "{{ (use_openvswitch_system_container | default(use_system_containers) | bool) }}"
l_is_node_system_container: "{{ (use_node_system_container | default(use_system_containers) | bool) }}"
diff --git a/roles/openshift_master_facts/filter_plugins/oo_filters.py b/roles/openshift_master_facts/filter_plugins/oo_filters.py
new file mode 120000
index 000000000..6f9bc47c1
--- /dev/null
+++ b/roles/openshift_master_facts/filter_plugins/oo_filters.py
@@ -0,0 +1 @@
+../../../filter_plugins/oo_filters.py \ No newline at end of file
diff --git a/filter_plugins/openshift_master.py b/roles/openshift_master_facts/filter_plugins/openshift_master.py
index 6d009077a..6d009077a 100644
--- a/filter_plugins/openshift_master.py
+++ b/roles/openshift_master_facts/filter_plugins/openshift_master.py
diff --git a/roles/openshift_master_facts/lookup_plugins/oo_option.py b/roles/openshift_master_facts/lookup_plugins/oo_option.py
new file mode 120000
index 000000000..5ae43f8dd
--- /dev/null
+++ b/roles/openshift_master_facts/lookup_plugins/oo_option.py
@@ -0,0 +1 @@
+../../../lookup_plugins/oo_option.py \ No newline at end of file
diff --git a/roles/openshift_master_facts/tasks/main.yml b/roles/openshift_master_facts/tasks/main.yml
index 74885d713..6f8f09b22 100644
--- a/roles/openshift_master_facts/tasks/main.yml
+++ b/roles/openshift_master_facts/tasks/main.yml
@@ -6,7 +6,8 @@
openshift_master_default_subdomain: "{{ osm_default_subdomain | default(None) }}"
when: openshift_master_default_subdomain is not defined
-- fail:
+- name: Verify required variables are set
+ fail:
msg: openshift_master_default_subdomain must be set to deploy metrics
when: openshift_hosted_metrics_deploy | default(false) | bool and openshift_master_default_subdomain | default("") == ""
@@ -17,7 +18,8 @@
# path must stay consistent. As such if openshift_hosted_metrics_public_url is set in
# inventory, we extract the hostname, and then reset openshift_hosted_metrics_public_url
# to the format that we know is valid. (This may change in future)
-- set_fact:
+- name: Set g_metrics_hostname
+ set_fact:
g_metrics_hostname: "{{ openshift_hosted_metrics_public_url
| default('hawkular-metrics.' ~ (openshift_master_default_subdomain))
| oo_hostname_from_url }}"
@@ -108,7 +110,8 @@
path: "{{ openshift_master_scheduler_conf }}"
register: scheduler_config_stat
-- set_fact:
+- name: Set Default scheduler predicates and priorities
+ set_fact:
openshift_master_scheduler_default_predicates: "{{ lookup('openshift_master_facts_default_predicates') }}"
openshift_master_scheduler_default_priorities: "{{ lookup('openshift_master_facts_default_priorities') }}"
@@ -118,14 +121,17 @@
src: "{{ openshift_master_scheduler_conf }}"
register: current_scheduler_config
- - set_fact:
+ - name: Set openshift_master_scheduler_current_config
+ set_fact:
openshift_master_scheduler_current_config: "{{ current_scheduler_config.content | b64decode | from_json }}"
- - fail:
+ - name: Test if scheduler config is readable
+ fail:
msg: "Unknown scheduler config apiVersion {{ openshift_master_scheduler_config.apiVersion }}"
when: "{{ openshift_master_scheduler_current_config.apiVersion | default(None) != 'v1' }}"
- - set_fact:
+ - name: Set current scheduler predicates and priorities
+ set_fact:
openshift_master_scheduler_current_predicates: "{{ openshift_master_scheduler_current_config.predicates }}"
openshift_master_scheduler_current_priorities: "{{ openshift_master_scheduler_current_config.priorities }}"
when: "{{ scheduler_config_stat.stat.exists }}"