diff options
author | Andrew Butcher <abutcher@afrolegs.com> | 2016-12-05 17:28:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-05 17:28:31 -0500 |
commit | a3ce4c106304773b6002458dfb113de9fd36efde (patch) | |
tree | 7a777ea5e83300f22d2fdf838ef675dd8271c5f2 | |
parent | 49ad2e283c7ed68e83c5d8f2ad7e89a189833cbd (diff) | |
parent | 3094794acf9e9441b3333b0149c555a3d493a218 (diff) | |
download | openshift-a3ce4c106304773b6002458dfb113de9fd36efde.tar.gz openshift-a3ce4c106304773b6002458dfb113de9fd36efde.tar.bz2 openshift-a3ce4c106304773b6002458dfb113de9fd36efde.tar.xz openshift-a3ce4c106304773b6002458dfb113de9fd36efde.zip |
Merge pull request #2920 from detiber/schedulerVarFix
Scheduler var fix
-rw-r--r-- | playbooks/byo/openshift-cluster/config.yml | 2 | ||||
-rw-r--r-- | roles/openshift_master/vars/main.yml | 8 | ||||
-rw-r--r-- | roles/openshift_master_facts/tasks/main.yml | 28 |
3 files changed, 18 insertions, 20 deletions
diff --git a/playbooks/byo/openshift-cluster/config.yml b/playbooks/byo/openshift-cluster/config.yml index 7216a151f..df00106d3 100644 --- a/playbooks/byo/openshift-cluster/config.yml +++ b/playbooks/byo/openshift-cluster/config.yml @@ -1,5 +1,7 @@ --- - include: ../../common/openshift-cluster/verify_ansible_version.yml + tags: + - always - name: Create initial host groups for localhost hosts: localhost diff --git a/roles/openshift_master/vars/main.yml b/roles/openshift_master/vars/main.yml index 4dce63630..01cd28c66 100644 --- a/roles/openshift_master/vars/main.yml +++ b/roles/openshift_master/vars/main.yml @@ -7,8 +7,12 @@ openshift_master_policy: "{{ openshift_master_config_dir }}/policy.json" scheduler_config: kind: Policy apiVersion: v1 - predicates: "{{ openshift_master_scheduler_predicates }}" - priorities: "{{ openshift_master_scheduler_priorities }}" + predicates: "{{ openshift_master_scheduler_predicates + | default(openshift_master_scheduler_current_predicates + | default(openshift_master_scheduler_default_predicates)) }}" + priorities: "{{ openshift_master_scheduler_priorities + | default(openshift_master_scheduler_current_priorities + | default(openshift_master_scheduler_default_priorities)) }}" openshift_master_valid_grant_methods: - auto diff --git a/roles/openshift_master_facts/tasks/main.yml b/roles/openshift_master_facts/tasks/main.yml index 170861484..e1cd94d75 100644 --- a/roles/openshift_master_facts/tasks/main.yml +++ b/roles/openshift_master_facts/tasks/main.yml @@ -83,15 +83,9 @@ path: "{{ openshift_master_scheduler_conf }}" register: scheduler_config_stat -- block: - - set_fact: - openshift_master_scheduler_predicates: "{{ lookup('openshift_master_facts_default_predicates') }}" - when: "{{ openshift_master_scheduler_predicates is not defined }}" - - - set_fact: - openshift_master_scheduler_priorities: "{{ lookup('openshift_master_facts_default_priorities') }}" - when: "{{ openshift_master_scheduler_priorities is not defined }}" - when: "{{ not scheduler_config_stat.stat.exists }}" +- set_fact: + openshift_master_scheduler_default_predicates: "{{ lookup('openshift_master_facts_default_predicates') }}" + openshift_master_scheduler_default_priorities: "{{ lookup('openshift_master_facts_default_priorities') }}" - block: - name: Retrieve current scheduler config @@ -99,16 +93,14 @@ src: "{{ openshift_master_scheduler_conf }}" register: current_scheduler_config - - fail: - msg: "Could not decode scheduler config" - when: "{{ (current_scheduler_config.content | b64decode | from_json).apiVersion | default(none) != 'v1' }}" - - set_fact: - openshift_master_scheduler_predicates: "{{ (current_scheduler_config.content | b64decode | from_json).predicates }}" - when: "{{ openshift_master_scheduler_predicates is not defined }}" + openshift_master_scheduler_current_config: "{{ current_scheduler_config.content | b64decode | from_json }}" - - set_fact: - openshift_master_scheduler_priorities: "{{ (current_scheduler_config.content | b64decode | from_json).priorities }}" - when: "{{ openshift_master_scheduler_priorities is not defined }}" + - fail: + msg: "Unknown scheduler config apiVersion {{ openshift_master_scheduler_config.apiVersion }}" + when: "{{ openshift_master_scheduler_current_config.apiVersion | default(None) != 'v1' }}" + - 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 }}" |