From 70957a529da6b00c3c614f4f1b1f04385e0ef61a Mon Sep 17 00:00:00 2001 From: Michael Gugino Date: Thu, 8 Feb 2018 16:55:16 -0500 Subject: Limit host scope during plays Many plays only target a select subset of hosts, especially oo_first_master for components such as logging and registry. This commit limits the scope of most plays to eliminate unnecessary task execution on node groups. This will result in great time savings for large deployments. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1516526 --- playbooks/container-runtime/config.yml | 4 +++- playbooks/container-runtime/setup_storage.yml | 4 +++- playbooks/init/main.yml | 4 ++-- playbooks/openshift-etcd/certificates.yml | 6 ++++++ playbooks/openshift-etcd/config.yml | 6 ++++++ playbooks/openshift-etcd/embedded2external.yml | 6 ++++++ playbooks/openshift-etcd/migrate.yml | 6 ++++++ playbooks/openshift-etcd/redeploy-ca.yml | 6 ++++++ playbooks/openshift-etcd/redeploy-certificates.yml | 6 ++++++ playbooks/openshift-etcd/restart.yml | 6 ++++++ playbooks/openshift-etcd/scaleup.yml | 4 +++- playbooks/openshift-etcd/upgrade.yml | 4 +++- playbooks/openshift-glusterfs/config.yml | 5 +++++ playbooks/openshift-glusterfs/registry.yml | 5 +++++ playbooks/openshift-grafana/config.yml | 5 +++++ playbooks/openshift-hosted/config.yml | 5 +++++ playbooks/openshift-hosted/deploy_registry.yml | 5 +++++ playbooks/openshift-hosted/deploy_router.yml | 5 +++++ playbooks/openshift-hosted/redeploy-registry-certificates.yml | 5 +++++ playbooks/openshift-hosted/redeploy-router-certificates.yml | 5 +++++ playbooks/openshift-loadbalancer/config.yml | 5 +++++ playbooks/openshift-logging/config.yml | 5 +++++ playbooks/openshift-management/config.yml | 5 +++++ playbooks/openshift-metrics/config.yml | 6 ++++++ playbooks/openshift-nfs/config.yml | 6 ++++++ playbooks/openshift-prometheus/config.yml | 6 ++++++ playbooks/openshift-provisioners/config.yml | 6 ++++++ playbooks/openshift-service-catalog/config.yml | 6 ++++++ playbooks/openshift-web-console/config.yml | 5 +++++ playbooks/prerequisites.yml | 4 +++- 30 files changed, 149 insertions(+), 7 deletions(-) (limited to 'playbooks') diff --git a/playbooks/container-runtime/config.yml b/playbooks/container-runtime/config.yml index f15aa771f..d7f3634ec 100644 --- a/playbooks/container-runtime/config.yml +++ b/playbooks/container-runtime/config.yml @@ -1,6 +1,8 @@ --- - import_playbook: ../init/main.yml vars: - skip_verison: True + skip_version: True + l_openshift_version_set_hosts: "all:!all" + l_openshift_version_check_hosts: "all:!all" - import_playbook: private/config.yml diff --git a/playbooks/container-runtime/setup_storage.yml b/playbooks/container-runtime/setup_storage.yml index 98e876b2c..17ff11cfd 100644 --- a/playbooks/container-runtime/setup_storage.yml +++ b/playbooks/container-runtime/setup_storage.yml @@ -1,6 +1,8 @@ --- - import_playbook: ../init/main.yml vars: - skip_verison: True + skip_version: True + l_openshift_version_set_hosts: "all:!all" + l_openshift_version_check_hosts: "all:!all" - import_playbook: private/setup_storage.yml diff --git a/playbooks/init/main.yml b/playbooks/init/main.yml index 9886691e0..468d81fbe 100644 --- a/playbooks/init/main.yml +++ b/playbooks/init/main.yml @@ -1,5 +1,5 @@ --- -# skip_verison and l_install_base_packages are passed in via prerequistes.yml. +# skip_version and l_install_base_packages are passed in via prerequistes.yml. # skip_sanity_checks is passed in via openshift-node/private/image_prep.yml - name: Initialization Checkpoint Start @@ -27,7 +27,7 @@ - import_playbook: cluster_facts.yml - import_playbook: version.yml - when: not (skip_verison | default(False)) + when: not (skip_version | default(False)) - import_playbook: sanity_checks.yml when: not (skip_sanity_checks | default(False)) diff --git a/playbooks/openshift-etcd/certificates.yml b/playbooks/openshift-etcd/certificates.yml index c06e3b575..86caba4e8 100644 --- a/playbooks/openshift-etcd/certificates.yml +++ b/playbooks/openshift-etcd/certificates.yml @@ -1,5 +1,11 @@ --- - import_playbook: ../init/main.yml + vars: + skip_version: True + l_openshift_version_set_hosts: "all:!all" + l_openshift_version_check_hosts: "all:!all" + l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config" + l_sanity_check_hosts: "{{ groups['oo_etcd_to_config'] | union(groups['oo_masters_to_config']) }}" - import_playbook: private/ca.yml diff --git a/playbooks/openshift-etcd/config.yml b/playbooks/openshift-etcd/config.yml index c7814207c..378edce85 100644 --- a/playbooks/openshift-etcd/config.yml +++ b/playbooks/openshift-etcd/config.yml @@ -1,4 +1,10 @@ --- - import_playbook: ../init/main.yml + vars: + skip_version: True + l_openshift_version_set_hosts: "all:!all" + l_openshift_version_check_hosts: "all:!all" + l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config" + l_sanity_check_hosts: "{{ groups['oo_etcd_to_config'] | union(groups['oo_masters_to_config']) }}" - import_playbook: private/config.yml diff --git a/playbooks/openshift-etcd/embedded2external.yml b/playbooks/openshift-etcd/embedded2external.yml index 7d090fa9b..34be38ac0 100644 --- a/playbooks/openshift-etcd/embedded2external.yml +++ b/playbooks/openshift-etcd/embedded2external.yml @@ -1,4 +1,10 @@ --- - import_playbook: ../init/main.yml + vars: + skip_version: True + l_openshift_version_set_hosts: "all:!all" + l_openshift_version_check_hosts: "all:!all" + l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config" + l_sanity_check_hosts: "{{ groups['oo_etcd_to_config'] | union(groups['oo_masters_to_config']) }}" - import_playbook: private/embedded2external.yml diff --git a/playbooks/openshift-etcd/migrate.yml b/playbooks/openshift-etcd/migrate.yml index 0340b74a5..4e8238ebd 100644 --- a/playbooks/openshift-etcd/migrate.yml +++ b/playbooks/openshift-etcd/migrate.yml @@ -1,4 +1,10 @@ --- - import_playbook: ../init/main.yml + vars: + skip_version: True + l_openshift_version_set_hosts: "all:!all" + l_openshift_version_check_hosts: "all:!all" + l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config" + l_sanity_check_hosts: "{{ groups['oo_etcd_to_config'] | union(groups['oo_masters_to_config']) }}" - import_playbook: private/migrate.yml diff --git a/playbooks/openshift-etcd/redeploy-ca.yml b/playbooks/openshift-etcd/redeploy-ca.yml index 769d694ba..93b68a257 100644 --- a/playbooks/openshift-etcd/redeploy-ca.yml +++ b/playbooks/openshift-etcd/redeploy-ca.yml @@ -1,4 +1,10 @@ --- - import_playbook: ../init/main.yml + vars: + skip_version: True + l_openshift_version_set_hosts: "all:!all" + l_openshift_version_check_hosts: "all:!all" + l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config" + l_sanity_check_hosts: "{{ groups['oo_etcd_to_config'] | union(groups['oo_masters_to_config']) }}" - import_playbook: private/redeploy-ca.yml diff --git a/playbooks/openshift-etcd/redeploy-certificates.yml b/playbooks/openshift-etcd/redeploy-certificates.yml index 8ea1994f7..202acb493 100644 --- a/playbooks/openshift-etcd/redeploy-certificates.yml +++ b/playbooks/openshift-etcd/redeploy-certificates.yml @@ -1,5 +1,11 @@ --- - import_playbook: ../init/main.yml + vars: + skip_version: True + l_openshift_version_set_hosts: "all:!all" + l_openshift_version_check_hosts: "all:!all" + l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config" + l_sanity_check_hosts: "{{ groups['oo_etcd_to_config'] | union(groups['oo_masters_to_config']) }}" - import_playbook: private/redeploy-certificates.yml diff --git a/playbooks/openshift-etcd/restart.yml b/playbooks/openshift-etcd/restart.yml index 041c1384d..05aaa9809 100644 --- a/playbooks/openshift-etcd/restart.yml +++ b/playbooks/openshift-etcd/restart.yml @@ -1,4 +1,10 @@ --- - import_playbook: ../init/main.yml + vars: + skip_version: True + l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config" + l_openshift_version_set_hosts: "all:!all" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_etcd_to_config'] | union(groups['oo_masters_to_config']) }}" - import_playbook: private/restart.yml diff --git a/playbooks/openshift-etcd/scaleup.yml b/playbooks/openshift-etcd/scaleup.yml index 1f8cb7391..3e2fca8d4 100644 --- a/playbooks/openshift-etcd/scaleup.yml +++ b/playbooks/openshift-etcd/scaleup.yml @@ -43,8 +43,10 @@ # prerequisites, we can just init facts as normal. - import_playbook: ../init/main.yml vars: - skip_verison: True + skip_version: True l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config:oo_new_etcd_to_config" + l_openshift_version_set_hosts: "all:!all" + l_openshift_version_check_hosts: "all:!all" when: - inventory_hostname in groups['oo_masters'] - inventory_hostname in groups['oo_nodes_to_config'] diff --git a/playbooks/openshift-etcd/upgrade.yml b/playbooks/openshift-etcd/upgrade.yml index 77999d92c..1edcd6819 100644 --- a/playbooks/openshift-etcd/upgrade.yml +++ b/playbooks/openshift-etcd/upgrade.yml @@ -1,7 +1,9 @@ --- - import_playbook: ../init/main.yml vars: - skip_verison: True + skip_version: True + l_openshift_version_set_hosts: "all:!all" + l_openshift_version_check_hosts: "all:!all" l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config" l_sanity_check_hosts: "{{ groups['oo_etcd_to_config'] | union(groups['oo_masters_to_config']) }}" diff --git a/playbooks/openshift-glusterfs/config.yml b/playbooks/openshift-glusterfs/config.yml index c7814207c..ccdd8d069 100644 --- a/playbooks/openshift-glusterfs/config.yml +++ b/playbooks/openshift-glusterfs/config.yml @@ -1,4 +1,9 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config:oo_glusterfs_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] | union(groups['oo_glusterfs_to_config']) }}" - import_playbook: private/config.yml diff --git a/playbooks/openshift-glusterfs/registry.yml b/playbooks/openshift-glusterfs/registry.yml index 5e3b18536..cc2846cb3 100644 --- a/playbooks/openshift-glusterfs/registry.yml +++ b/playbooks/openshift-glusterfs/registry.yml @@ -1,4 +1,9 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config:oo_glusterfs_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] | union(groups['oo_glusterfs_to_config']) }}" - import_playbook: private/registry.yml diff --git a/playbooks/openshift-grafana/config.yml b/playbooks/openshift-grafana/config.yml index c7814207c..62d954d29 100644 --- a/playbooks/openshift-grafana/config.yml +++ b/playbooks/openshift-grafana/config.yml @@ -1,4 +1,9 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] }}" - import_playbook: private/config.yml diff --git a/playbooks/openshift-hosted/config.yml b/playbooks/openshift-hosted/config.yml index c7814207c..62d954d29 100644 --- a/playbooks/openshift-hosted/config.yml +++ b/playbooks/openshift-hosted/config.yml @@ -1,4 +1,9 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] }}" - import_playbook: private/config.yml diff --git a/playbooks/openshift-hosted/deploy_registry.yml b/playbooks/openshift-hosted/deploy_registry.yml index 2453329dd..e42af7149 100644 --- a/playbooks/openshift-hosted/deploy_registry.yml +++ b/playbooks/openshift-hosted/deploy_registry.yml @@ -1,4 +1,9 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] }}" - import_playbook: private/openshift_hosted_registry.yml diff --git a/playbooks/openshift-hosted/deploy_router.yml b/playbooks/openshift-hosted/deploy_router.yml index e832eeeea..a3564fe51 100644 --- a/playbooks/openshift-hosted/deploy_router.yml +++ b/playbooks/openshift-hosted/deploy_router.yml @@ -1,4 +1,9 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] }}" - import_playbook: private/openshift_hosted_router.yml diff --git a/playbooks/openshift-hosted/redeploy-registry-certificates.yml b/playbooks/openshift-hosted/redeploy-registry-certificates.yml index 518a1d624..1ab237558 100644 --- a/playbooks/openshift-hosted/redeploy-registry-certificates.yml +++ b/playbooks/openshift-hosted/redeploy-registry-certificates.yml @@ -1,4 +1,9 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] }}" - import_playbook: private/redeploy-registry-certificates.yml diff --git a/playbooks/openshift-hosted/redeploy-router-certificates.yml b/playbooks/openshift-hosted/redeploy-router-certificates.yml index a74dd8c79..4b44be405 100644 --- a/playbooks/openshift-hosted/redeploy-router-certificates.yml +++ b/playbooks/openshift-hosted/redeploy-router-certificates.yml @@ -1,4 +1,9 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] }}" - import_playbook: private/redeploy-router-certificates.yml diff --git a/playbooks/openshift-loadbalancer/config.yml b/playbooks/openshift-loadbalancer/config.yml index c7814207c..13903ee17 100644 --- a/playbooks/openshift-loadbalancer/config.yml +++ b/playbooks/openshift-loadbalancer/config.yml @@ -1,4 +1,9 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config:oo_lb_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] | union(groups['oo_lb_to_config']) }}" - import_playbook: private/config.yml diff --git a/playbooks/openshift-logging/config.yml b/playbooks/openshift-logging/config.yml index 83d330284..419dcbc3f 100644 --- a/playbooks/openshift-logging/config.yml +++ b/playbooks/openshift-logging/config.yml @@ -5,5 +5,10 @@ # currently supported method. # - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] }}" - import_playbook: private/config.yml diff --git a/playbooks/openshift-management/config.yml b/playbooks/openshift-management/config.yml index c7814207c..62d954d29 100644 --- a/playbooks/openshift-management/config.yml +++ b/playbooks/openshift-management/config.yml @@ -1,4 +1,9 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] }}" - import_playbook: private/config.yml diff --git a/playbooks/openshift-metrics/config.yml b/playbooks/openshift-metrics/config.yml index c7814207c..1ca68fb9e 100644 --- a/playbooks/openshift-metrics/config.yml +++ b/playbooks/openshift-metrics/config.yml @@ -1,4 +1,10 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] }}" + - import_playbook: private/config.yml diff --git a/playbooks/openshift-nfs/config.yml b/playbooks/openshift-nfs/config.yml index c7814207c..b22796228 100644 --- a/playbooks/openshift-nfs/config.yml +++ b/playbooks/openshift-nfs/config.yml @@ -1,4 +1,10 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config:oo_nfs_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] | union(groups['oo_nfs_to_config']) }}" + - import_playbook: private/config.yml diff --git a/playbooks/openshift-prometheus/config.yml b/playbooks/openshift-prometheus/config.yml index c7814207c..1ca68fb9e 100644 --- a/playbooks/openshift-prometheus/config.yml +++ b/playbooks/openshift-prometheus/config.yml @@ -1,4 +1,10 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] }}" + - import_playbook: private/config.yml diff --git a/playbooks/openshift-provisioners/config.yml b/playbooks/openshift-provisioners/config.yml index c7814207c..1ca68fb9e 100644 --- a/playbooks/openshift-provisioners/config.yml +++ b/playbooks/openshift-provisioners/config.yml @@ -1,4 +1,10 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] }}" + - import_playbook: private/config.yml diff --git a/playbooks/openshift-service-catalog/config.yml b/playbooks/openshift-service-catalog/config.yml index c7814207c..1ca68fb9e 100644 --- a/playbooks/openshift-service-catalog/config.yml +++ b/playbooks/openshift-service-catalog/config.yml @@ -1,4 +1,10 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] }}" + - import_playbook: private/config.yml diff --git a/playbooks/openshift-web-console/config.yml b/playbooks/openshift-web-console/config.yml index c7814207c..62d954d29 100644 --- a/playbooks/openshift-web-console/config.yml +++ b/playbooks/openshift-web-console/config.yml @@ -1,4 +1,9 @@ --- - import_playbook: ../init/main.yml + vars: + l_init_fact_hosts: "oo_masters_to_config" + l_openshift_version_set_hosts: "oo_masters_to_config:!oo_first_master" + l_openshift_version_check_hosts: "all:!all" + l_sanity_check_hosts: "{{ groups['oo_masters_to_config'] }}" - import_playbook: private/config.yml diff --git a/playbooks/prerequisites.yml b/playbooks/prerequisites.yml index 0b76ca862..544adbd4d 100644 --- a/playbooks/prerequisites.yml +++ b/playbooks/prerequisites.yml @@ -3,8 +3,10 @@ - import_playbook: init/main.yml vars: - skip_verison: True + skip_version: True l_install_base_packages: True + l_openshift_version_set_hosts: "all:!all" + l_openshift_version_check_hosts: "all:!all" - import_playbook: init/validate_hostnames.yml when: not (skip_validate_hostnames | default(False)) -- cgit v1.2.3