From a495780e61e824dddeaf35b9d58b6b37e300505c Mon Sep 17 00:00:00 2001 From: Russell Teague Date: Tue, 21 Nov 2017 16:47:48 -0500 Subject: Playbook Consolidation - openshift-hosted --- playbooks/aws/openshift-cluster/hosted.yml | 5 ++- .../byo/openshift-cluster/openshift-hosted.yml | 4 -- .../byo/openshift-cluster/openshift-prometheus.yml | 4 -- playbooks/common/openshift-cluster/cockpit-ui.yml | 8 ---- playbooks/common/openshift-cluster/config.yml | 5 ++- .../create_persistent_volumes.yml | 9 ----- .../common/openshift-cluster/install_docker_gc.yml | 7 ---- .../openshift_default_storage_class.yml | 6 --- .../common/openshift-cluster/openshift_hosted.yml | 44 ---------------------- .../openshift_hosted_create_projects.yml | 7 ---- .../openshift_hosted_registry.yml | 13 ------- .../openshift-cluster/openshift_hosted_router.yml | 13 ------- .../openshift-cluster/openshift_prometheus.yml | 29 -------------- playbooks/openshift-hosted/config.yml | 4 ++ playbooks/openshift-hosted/private/cockpit-ui.yml | 8 ++++ playbooks/openshift-hosted/private/config.yml | 41 ++++++++++++++++++++ .../private/create_persistent_volumes.yml | 9 +++++ .../openshift-hosted/private/install_docker_gc.yml | 7 ++++ .../private/openshift_default_storage_class.yml | 6 +++ .../private/openshift_hosted_create_projects.yml | 7 ++++ .../private/openshift_hosted_registry.yml | 13 +++++++ .../private/openshift_hosted_router.yml | 13 +++++++ playbooks/openshift-hosted/private/roles | 1 + playbooks/openshift-prometheus/config.yml | 4 ++ playbooks/openshift-prometheus/private/config.yml | 29 ++++++++++++++ playbooks/openshift-prometheus/private/roles | 1 + .../callback_plugins/installer_checkpoint.py | 4 +- 27 files changed, 153 insertions(+), 148 deletions(-) delete mode 100644 playbooks/byo/openshift-cluster/openshift-hosted.yml delete mode 100644 playbooks/byo/openshift-cluster/openshift-prometheus.yml delete mode 100644 playbooks/common/openshift-cluster/cockpit-ui.yml delete mode 100644 playbooks/common/openshift-cluster/create_persistent_volumes.yml delete mode 100644 playbooks/common/openshift-cluster/install_docker_gc.yml delete mode 100644 playbooks/common/openshift-cluster/openshift_default_storage_class.yml delete mode 100644 playbooks/common/openshift-cluster/openshift_hosted.yml delete mode 100644 playbooks/common/openshift-cluster/openshift_hosted_create_projects.yml delete mode 100644 playbooks/common/openshift-cluster/openshift_hosted_registry.yml delete mode 100644 playbooks/common/openshift-cluster/openshift_hosted_router.yml delete mode 100644 playbooks/common/openshift-cluster/openshift_prometheus.yml create mode 100644 playbooks/openshift-hosted/config.yml create mode 100644 playbooks/openshift-hosted/private/cockpit-ui.yml create mode 100644 playbooks/openshift-hosted/private/config.yml create mode 100644 playbooks/openshift-hosted/private/create_persistent_volumes.yml create mode 100644 playbooks/openshift-hosted/private/install_docker_gc.yml create mode 100644 playbooks/openshift-hosted/private/openshift_default_storage_class.yml create mode 100644 playbooks/openshift-hosted/private/openshift_hosted_create_projects.yml create mode 100644 playbooks/openshift-hosted/private/openshift_hosted_registry.yml create mode 100644 playbooks/openshift-hosted/private/openshift_hosted_router.yml create mode 120000 playbooks/openshift-hosted/private/roles create mode 100644 playbooks/openshift-prometheus/config.yml create mode 100644 playbooks/openshift-prometheus/private/config.yml create mode 120000 playbooks/openshift-prometheus/private/roles diff --git a/playbooks/aws/openshift-cluster/hosted.yml b/playbooks/aws/openshift-cluster/hosted.yml index db6e3b8e1..6bdd72464 100644 --- a/playbooks/aws/openshift-cluster/hosted.yml +++ b/playbooks/aws/openshift-cluster/hosted.yml @@ -1,5 +1,5 @@ --- -- include: ../../common/openshift-cluster/openshift_hosted.yml +- include: ../../openshift-hosted/private/config.yml - include: ../../common/openshift-cluster/openshift_metrics.yml when: openshift_metrics_install_metrics | default(false) | bool @@ -7,6 +7,9 @@ - include: ../../common/openshift-cluster/openshift_logging.yml when: openshift_logging_install_logging | default(false) | bool +- include: ../../openshift-prometheus/private/config.yml + when: openshift_hosted_prometheus_deploy | default(false) | bool + - include: ../../common/openshift-cluster/service_catalog.yml when: openshift_enable_service_catalog | default(false) | bool diff --git a/playbooks/byo/openshift-cluster/openshift-hosted.yml b/playbooks/byo/openshift-cluster/openshift-hosted.yml deleted file mode 100644 index 0855a2fb6..000000000 --- a/playbooks/byo/openshift-cluster/openshift-hosted.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- include: ../../init/main.yml - -- include: ../../common/openshift-cluster/openshift_hosted.yml diff --git a/playbooks/byo/openshift-cluster/openshift-prometheus.yml b/playbooks/byo/openshift-cluster/openshift-prometheus.yml deleted file mode 100644 index 634ee2a80..000000000 --- a/playbooks/byo/openshift-cluster/openshift-prometheus.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- include: ../../init/main.yml - -- include: ../../common/openshift-cluster/openshift_prometheus.yml diff --git a/playbooks/common/openshift-cluster/cockpit-ui.yml b/playbooks/common/openshift-cluster/cockpit-ui.yml deleted file mode 100644 index 359132dd0..000000000 --- a/playbooks/common/openshift-cluster/cockpit-ui.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Create Hosted Resources - cockpit-ui - hosts: oo_first_master - roles: - - role: cockpit-ui - when: - - openshift_hosted_manage_registry | default(true) | bool - - not openshift.docker.hosted_registry_insecure | default(false) | bool diff --git a/playbooks/common/openshift-cluster/config.yml b/playbooks/common/openshift-cluster/config.yml index 81b163b80..2e93e1462 100644 --- a/playbooks/common/openshift-cluster/config.yml +++ b/playbooks/common/openshift-cluster/config.yml @@ -18,7 +18,7 @@ - include: ../openshift-glusterfs/config.yml when: groups.oo_glusterfs_to_config | default([]) | count > 0 -- include: openshift_hosted.yml +- include: ../../openshift-hosted/private/config.yml - include: openshift_metrics.yml when: openshift_metrics_install_metrics | default(false) | bool @@ -26,6 +26,9 @@ - include: openshift_logging.yml when: openshift_logging_install_logging | default(false) | bool +- include: ../../openshift-prometheus/private/config.yml + when: openshift_hosted_prometheus_deploy | default(false) | bool + - include: service_catalog.yml when: openshift_enable_service_catalog | default(true) | bool diff --git a/playbooks/common/openshift-cluster/create_persistent_volumes.yml b/playbooks/common/openshift-cluster/create_persistent_volumes.yml deleted file mode 100644 index 8a60a30b8..000000000 --- a/playbooks/common/openshift-cluster/create_persistent_volumes.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- name: Create Hosted Resources - persistent volumes - hosts: oo_first_master - vars: - persistent_volumes: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volumes(groups) }}" - persistent_volume_claims: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volume_claims }}" - roles: - - role: openshift_persistent_volumes - when: persistent_volumes | length > 0 or persistent_volume_claims | length > 0 diff --git a/playbooks/common/openshift-cluster/install_docker_gc.yml b/playbooks/common/openshift-cluster/install_docker_gc.yml deleted file mode 100644 index 1e3dfee07..000000000 --- a/playbooks/common/openshift-cluster/install_docker_gc.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Install docker gc - hosts: oo_first_master - gather_facts: false - tasks: - - include_role: - name: openshift_docker_gc diff --git a/playbooks/common/openshift-cluster/openshift_default_storage_class.yml b/playbooks/common/openshift-cluster/openshift_default_storage_class.yml deleted file mode 100644 index 62fe0dd60..000000000 --- a/playbooks/common/openshift-cluster/openshift_default_storage_class.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Create Hosted Resources - openshift_default_storage_class - hosts: oo_first_master - roles: - - role: openshift_default_storage_class - when: openshift_cloudprovider_kind is defined and (openshift_cloudprovider_kind == 'aws' or openshift_cloudprovider_kind == 'gce' or openshift_cloudprovider_kind == 'openstack') diff --git a/playbooks/common/openshift-cluster/openshift_hosted.yml b/playbooks/common/openshift-cluster/openshift_hosted.yml deleted file mode 100644 index 15ee60dc0..000000000 --- a/playbooks/common/openshift-cluster/openshift_hosted.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -- name: Hosted Install Checkpoint Start - hosts: all - gather_facts: false - tasks: - - name: Set Hosted install 'In Progress' - run_once: true - set_stats: - data: - installer_phase_hosted: - status: "In Progress" - start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" - -- include: create_persistent_volumes.yml - -- include: openshift_default_storage_class.yml - -- include: openshift_hosted_create_projects.yml - -- include: openshift_hosted_router.yml - -- include: openshift_hosted_registry.yml - -- include: cockpit-ui.yml - -- include: openshift_prometheus.yml - when: openshift_hosted_prometheus_deploy | default(False) | bool - -- include: install_docker_gc.yml - when: - - openshift_use_crio | default(False) | bool - - openshift_crio_enable_docker_gc | default(False) | bool - -- name: Hosted Install Checkpoint End - hosts: all - gather_facts: false - tasks: - - name: Set Hosted install 'Complete' - run_once: true - set_stats: - data: - installer_phase_hosted: - status: "Complete" - end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" diff --git a/playbooks/common/openshift-cluster/openshift_hosted_create_projects.yml b/playbooks/common/openshift-cluster/openshift_hosted_create_projects.yml deleted file mode 100644 index d5ca5185c..000000000 --- a/playbooks/common/openshift-cluster/openshift_hosted_create_projects.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Create Hosted Resources - openshift projects - hosts: oo_first_master - tasks: - - include_role: - name: openshift_hosted - tasks_from: create_projects.yml diff --git a/playbooks/common/openshift-cluster/openshift_hosted_registry.yml b/playbooks/common/openshift-cluster/openshift_hosted_registry.yml deleted file mode 100644 index 2a91a827c..000000000 --- a/playbooks/common/openshift-cluster/openshift_hosted_registry.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Create Hosted Resources - registry - hosts: oo_first_master - tasks: - - set_fact: - openshift_hosted_registry_registryurl: "{{ hostvars[groups.oo_first_master.0].openshift.master.registry_url }}" - when: "'master' in hostvars[groups.oo_first_master.0].openshift and 'registry_url' in hostvars[groups.oo_first_master.0].openshift.master" - - include_role: - name: openshift_hosted - tasks_from: registry.yml - when: - - openshift_hosted_manage_registry | default(True) | bool - - openshift_hosted_registry_registryurl is defined diff --git a/playbooks/common/openshift-cluster/openshift_hosted_router.yml b/playbooks/common/openshift-cluster/openshift_hosted_router.yml deleted file mode 100644 index bcb5a34a4..000000000 --- a/playbooks/common/openshift-cluster/openshift_hosted_router.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Create Hosted Resources - router - hosts: oo_first_master - tasks: - - set_fact: - openshift_hosted_router_registryurl: "{{ hostvars[groups.oo_first_master.0].openshift.master.registry_url }}" - when: "'master' in hostvars[groups.oo_first_master.0].openshift and 'registry_url' in hostvars[groups.oo_first_master.0].openshift.master" - - include_role: - name: openshift_hosted - tasks_from: router.yml - when: - - openshift_hosted_manage_router | default(True) | bool - - openshift_hosted_router_registryurl is defined diff --git a/playbooks/common/openshift-cluster/openshift_prometheus.yml b/playbooks/common/openshift-cluster/openshift_prometheus.yml deleted file mode 100644 index 7aa9a16e6..000000000 --- a/playbooks/common/openshift-cluster/openshift_prometheus.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -- name: Prometheus Install Checkpoint Start - hosts: all - gather_facts: false - tasks: - - name: Set Prometheus install 'In Progress' - run_once: true - set_stats: - data: - installer_phase_prometheus: - status: "In Progress" - start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" - -- name: Create Hosted Resources - openshift_prometheus - hosts: oo_first_master - roles: - - role: openshift_prometheus - -- name: Prometheus Install Checkpoint End - hosts: all - gather_facts: false - tasks: - - name: Set Prometheus install 'Complete' - run_once: true - set_stats: - data: - installer_phase_prometheus: - status: "Complete" - end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" diff --git a/playbooks/openshift-hosted/config.yml b/playbooks/openshift-hosted/config.yml new file mode 100644 index 000000000..8ee57ce8d --- /dev/null +++ b/playbooks/openshift-hosted/config.yml @@ -0,0 +1,4 @@ +--- +- include: ../init/main.yml + +- include: private/config.yml diff --git a/playbooks/openshift-hosted/private/cockpit-ui.yml b/playbooks/openshift-hosted/private/cockpit-ui.yml new file mode 100644 index 000000000..359132dd0 --- /dev/null +++ b/playbooks/openshift-hosted/private/cockpit-ui.yml @@ -0,0 +1,8 @@ +--- +- name: Create Hosted Resources - cockpit-ui + hosts: oo_first_master + roles: + - role: cockpit-ui + when: + - openshift_hosted_manage_registry | default(true) | bool + - not openshift.docker.hosted_registry_insecure | default(false) | bool diff --git a/playbooks/openshift-hosted/private/config.yml b/playbooks/openshift-hosted/private/config.yml new file mode 100644 index 000000000..6bcd02ba2 --- /dev/null +++ b/playbooks/openshift-hosted/private/config.yml @@ -0,0 +1,41 @@ +--- +- name: Hosted Install Checkpoint Start + hosts: all + gather_facts: false + tasks: + - name: Set Hosted install 'In Progress' + run_once: true + set_stats: + data: + installer_phase_hosted: + status: "In Progress" + start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" + +- include: create_persistent_volumes.yml + +- include: openshift_default_storage_class.yml + +- include: openshift_hosted_create_projects.yml + +- include: openshift_hosted_router.yml + +- include: openshift_hosted_registry.yml + +- include: cockpit-ui.yml + +- include: install_docker_gc.yml + when: + - openshift_use_crio | default(False) | bool + - openshift_crio_enable_docker_gc | default(False) | bool + +- name: Hosted Install Checkpoint End + hosts: all + gather_facts: false + tasks: + - name: Set Hosted install 'Complete' + run_once: true + set_stats: + data: + installer_phase_hosted: + status: "Complete" + end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" diff --git a/playbooks/openshift-hosted/private/create_persistent_volumes.yml b/playbooks/openshift-hosted/private/create_persistent_volumes.yml new file mode 100644 index 000000000..8a60a30b8 --- /dev/null +++ b/playbooks/openshift-hosted/private/create_persistent_volumes.yml @@ -0,0 +1,9 @@ +--- +- name: Create Hosted Resources - persistent volumes + hosts: oo_first_master + vars: + persistent_volumes: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volumes(groups) }}" + persistent_volume_claims: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volume_claims }}" + roles: + - role: openshift_persistent_volumes + when: persistent_volumes | length > 0 or persistent_volume_claims | length > 0 diff --git a/playbooks/openshift-hosted/private/install_docker_gc.yml b/playbooks/openshift-hosted/private/install_docker_gc.yml new file mode 100644 index 000000000..1e3dfee07 --- /dev/null +++ b/playbooks/openshift-hosted/private/install_docker_gc.yml @@ -0,0 +1,7 @@ +--- +- name: Install docker gc + hosts: oo_first_master + gather_facts: false + tasks: + - include_role: + name: openshift_docker_gc diff --git a/playbooks/openshift-hosted/private/openshift_default_storage_class.yml b/playbooks/openshift-hosted/private/openshift_default_storage_class.yml new file mode 100644 index 000000000..62fe0dd60 --- /dev/null +++ b/playbooks/openshift-hosted/private/openshift_default_storage_class.yml @@ -0,0 +1,6 @@ +--- +- name: Create Hosted Resources - openshift_default_storage_class + hosts: oo_first_master + roles: + - role: openshift_default_storage_class + when: openshift_cloudprovider_kind is defined and (openshift_cloudprovider_kind == 'aws' or openshift_cloudprovider_kind == 'gce' or openshift_cloudprovider_kind == 'openstack') diff --git a/playbooks/openshift-hosted/private/openshift_hosted_create_projects.yml b/playbooks/openshift-hosted/private/openshift_hosted_create_projects.yml new file mode 100644 index 000000000..d5ca5185c --- /dev/null +++ b/playbooks/openshift-hosted/private/openshift_hosted_create_projects.yml @@ -0,0 +1,7 @@ +--- +- name: Create Hosted Resources - openshift projects + hosts: oo_first_master + tasks: + - include_role: + name: openshift_hosted + tasks_from: create_projects.yml diff --git a/playbooks/openshift-hosted/private/openshift_hosted_registry.yml b/playbooks/openshift-hosted/private/openshift_hosted_registry.yml new file mode 100644 index 000000000..2a91a827c --- /dev/null +++ b/playbooks/openshift-hosted/private/openshift_hosted_registry.yml @@ -0,0 +1,13 @@ +--- +- name: Create Hosted Resources - registry + hosts: oo_first_master + tasks: + - set_fact: + openshift_hosted_registry_registryurl: "{{ hostvars[groups.oo_first_master.0].openshift.master.registry_url }}" + when: "'master' in hostvars[groups.oo_first_master.0].openshift and 'registry_url' in hostvars[groups.oo_first_master.0].openshift.master" + - include_role: + name: openshift_hosted + tasks_from: registry.yml + when: + - openshift_hosted_manage_registry | default(True) | bool + - openshift_hosted_registry_registryurl is defined diff --git a/playbooks/openshift-hosted/private/openshift_hosted_router.yml b/playbooks/openshift-hosted/private/openshift_hosted_router.yml new file mode 100644 index 000000000..bcb5a34a4 --- /dev/null +++ b/playbooks/openshift-hosted/private/openshift_hosted_router.yml @@ -0,0 +1,13 @@ +--- +- name: Create Hosted Resources - router + hosts: oo_first_master + tasks: + - set_fact: + openshift_hosted_router_registryurl: "{{ hostvars[groups.oo_first_master.0].openshift.master.registry_url }}" + when: "'master' in hostvars[groups.oo_first_master.0].openshift and 'registry_url' in hostvars[groups.oo_first_master.0].openshift.master" + - include_role: + name: openshift_hosted + tasks_from: router.yml + when: + - openshift_hosted_manage_router | default(True) | bool + - openshift_hosted_router_registryurl is defined diff --git a/playbooks/openshift-hosted/private/roles b/playbooks/openshift-hosted/private/roles new file mode 120000 index 000000000..20c4c58cf --- /dev/null +++ b/playbooks/openshift-hosted/private/roles @@ -0,0 +1 @@ +../../../roles \ No newline at end of file diff --git a/playbooks/openshift-prometheus/config.yml b/playbooks/openshift-prometheus/config.yml new file mode 100644 index 000000000..8ee57ce8d --- /dev/null +++ b/playbooks/openshift-prometheus/config.yml @@ -0,0 +1,4 @@ +--- +- include: ../init/main.yml + +- include: private/config.yml diff --git a/playbooks/openshift-prometheus/private/config.yml b/playbooks/openshift-prometheus/private/config.yml new file mode 100644 index 000000000..d13261a7a --- /dev/null +++ b/playbooks/openshift-prometheus/private/config.yml @@ -0,0 +1,29 @@ +--- +- name: Prometheus Install Checkpoint Start + hosts: all + gather_facts: false + tasks: + - name: Set Prometheus install 'In Progress' + run_once: true + set_stats: + data: + installer_phase_prometheus: + status: "In Progress" + start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" + +- name: OpenShift Prometheus + hosts: oo_first_master + roles: + - role: openshift_prometheus + +- name: Prometheus Install Checkpoint End + hosts: all + gather_facts: false + tasks: + - name: Set Prometheus install 'Complete' + run_once: true + set_stats: + data: + installer_phase_prometheus: + status: "Complete" + end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" diff --git a/playbooks/openshift-prometheus/private/roles b/playbooks/openshift-prometheus/private/roles new file mode 120000 index 000000000..20c4c58cf --- /dev/null +++ b/playbooks/openshift-prometheus/private/roles @@ -0,0 +1 @@ +../../../roles \ No newline at end of file diff --git a/roles/installer_checkpoint/callback_plugins/installer_checkpoint.py b/roles/installer_checkpoint/callback_plugins/installer_checkpoint.py index 525ca6ed5..cc080d4b9 100644 --- a/roles/installer_checkpoint/callback_plugins/installer_checkpoint.py +++ b/roles/installer_checkpoint/callback_plugins/installer_checkpoint.py @@ -78,7 +78,7 @@ class CallbackModule(CallbackBase): }, 'installer_phase_hosted': { 'title': 'Hosted Install', - 'playbook': 'playbooks/byo/openshift-cluster/openshift-hosted.yml' + 'playbook': 'playbooks/openshift-hosted/config.yml' }, 'installer_phase_metrics': { 'title': 'Metrics Install', @@ -90,7 +90,7 @@ class CallbackModule(CallbackBase): }, 'installer_phase_prometheus': { 'title': 'Prometheus Install', - 'playbook': 'playbooks/byo/openshift-cluster/openshift-prometheus.yml' + 'playbook': 'playbooks/openshift-prometheus/config.yml' }, 'installer_phase_servicecatalog': { 'title': 'Service Catalog Install', -- cgit v1.2.3