From 3d20df36ec19c6401eef0789aaa2e0d352e6db25 Mon Sep 17 00:00:00 2001 From: Russell Teague Date: Wed, 22 Nov 2017 08:59:55 -0500 Subject: Playbook Consolidation - openshift-management --- playbooks/aws/openshift-cluster/hosted.yml | 2 +- .../add_container_provider.yml | 4 --- .../add_many_container_providers.yml | 36 -------------------- playbooks/byo/openshift-management/config.yml | 4 --- playbooks/byo/openshift-management/roles | 1 - playbooks/byo/openshift-management/uninstall.yml | 2 -- playbooks/common/openshift-cluster/config.yml | 2 +- .../add_container_provider.yml | 8 ----- playbooks/common/openshift-management/config.yml | 39 ---------------------- .../common/openshift-management/filter_plugins | 1 - playbooks/common/openshift-management/library | 1 - playbooks/common/openshift-management/roles | 1 - .../common/openshift-management/uninstall.yml | 8 ----- .../add_container_provider.yml | 4 +++ .../add_many_container_providers.yml | 36 ++++++++++++++++++++ playbooks/openshift-management/config.yml | 4 +++ .../private/add_container_provider.yml | 8 +++++ playbooks/openshift-management/private/config.yml | 39 ++++++++++++++++++++++ .../openshift-management/private/filter_plugins | 1 + playbooks/openshift-management/private/library | 1 + playbooks/openshift-management/private/roles | 1 + .../openshift-management/private/uninstall.yml | 8 +++++ playbooks/openshift-management/roles | 1 + playbooks/openshift-management/uninstall.yml | 2 ++ .../callback_plugins/installer_checkpoint.py | 2 +- 25 files changed, 108 insertions(+), 108 deletions(-) delete mode 100644 playbooks/byo/openshift-management/add_container_provider.yml delete mode 100644 playbooks/byo/openshift-management/add_many_container_providers.yml delete mode 100644 playbooks/byo/openshift-management/config.yml delete mode 120000 playbooks/byo/openshift-management/roles delete mode 100644 playbooks/byo/openshift-management/uninstall.yml delete mode 100644 playbooks/common/openshift-management/add_container_provider.yml delete mode 100644 playbooks/common/openshift-management/config.yml delete mode 120000 playbooks/common/openshift-management/filter_plugins delete mode 120000 playbooks/common/openshift-management/library delete mode 120000 playbooks/common/openshift-management/roles delete mode 100644 playbooks/common/openshift-management/uninstall.yml create mode 100644 playbooks/openshift-management/add_container_provider.yml create mode 100644 playbooks/openshift-management/add_many_container_providers.yml create mode 100644 playbooks/openshift-management/config.yml create mode 100644 playbooks/openshift-management/private/add_container_provider.yml create mode 100644 playbooks/openshift-management/private/config.yml create mode 120000 playbooks/openshift-management/private/filter_plugins create mode 120000 playbooks/openshift-management/private/library create mode 120000 playbooks/openshift-management/private/roles create mode 100644 playbooks/openshift-management/private/uninstall.yml create mode 120000 playbooks/openshift-management/roles create mode 100644 playbooks/openshift-management/uninstall.yml diff --git a/playbooks/aws/openshift-cluster/hosted.yml b/playbooks/aws/openshift-cluster/hosted.yml index 3d3c871ca..9f65925fb 100644 --- a/playbooks/aws/openshift-cluster/hosted.yml +++ b/playbooks/aws/openshift-cluster/hosted.yml @@ -10,7 +10,7 @@ - include: ../../common/openshift-cluster/service_catalog.yml when: openshift_enable_service_catalog | default(false) | bool -- include: ../../common/openshift-management/config.yml +- include: ../../openshift-management/private/config.yml when: openshift_management_install_management | default(false) | bool - name: Print deprecated variable warning message if necessary diff --git a/playbooks/byo/openshift-management/add_container_provider.yml b/playbooks/byo/openshift-management/add_container_provider.yml deleted file mode 100644 index e2f558550..000000000 --- a/playbooks/byo/openshift-management/add_container_provider.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- include: ../../init/evaluate_groups.yml - -- include: ../../common/openshift-management/add_container_provider.yml diff --git a/playbooks/byo/openshift-management/add_many_container_providers.yml b/playbooks/byo/openshift-management/add_many_container_providers.yml deleted file mode 100644 index 62fdb11c5..000000000 --- a/playbooks/byo/openshift-management/add_many_container_providers.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- hosts: localhost - tasks: - - name: Ensure the container provider configuration is defined - assert: - that: container_providers_config is defined - msg: | - Error: Must provide providers config path. Fix: Add '-e container_providers_config=/path/to/your/config' to the ansible-playbook command - - - name: Include providers/management configuration - include_vars: - file: "{{ container_providers_config }}" - - - name: Ensure this cluster is a container provider - uri: - url: "https://{{ management_server['hostname'] }}/api/providers" - body_format: json - method: POST - user: "{{ management_server['user'] }}" - password: "{{ management_server['password'] }}" - validate_certs: no - # Docs on formatting the BODY of the POST request: - # http://manageiq.org/docs/reference/latest/api/reference/providers.html#specifying-connection-configurations - body: "{{ item }}" - failed_when: false - with_items: "{{ container_providers }}" - register: results - - # Include openshift_management for access to filter_plugins. - - include_role: - name: openshift_management - tasks_from: noop - - - name: print each result - debug: - msg: "{{ results.results | oo_filter_container_providers }}" diff --git a/playbooks/byo/openshift-management/config.yml b/playbooks/byo/openshift-management/config.yml deleted file mode 100644 index e699fd014..000000000 --- a/playbooks/byo/openshift-management/config.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- include: ../../init/main.yml - -- include: ../../common/openshift-management/config.yml diff --git a/playbooks/byo/openshift-management/roles b/playbooks/byo/openshift-management/roles deleted file mode 120000 index 20c4c58cf..000000000 --- a/playbooks/byo/openshift-management/roles +++ /dev/null @@ -1 +0,0 @@ -../../../roles \ No newline at end of file diff --git a/playbooks/byo/openshift-management/uninstall.yml b/playbooks/byo/openshift-management/uninstall.yml deleted file mode 100644 index e95c1c88a..000000000 --- a/playbooks/byo/openshift-management/uninstall.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include: ../../common/openshift-management/uninstall.yml diff --git a/playbooks/common/openshift-cluster/config.yml b/playbooks/common/openshift-cluster/config.yml index fce5b652d..a98b1df5f 100644 --- a/playbooks/common/openshift-cluster/config.yml +++ b/playbooks/common/openshift-cluster/config.yml @@ -29,7 +29,7 @@ - include: service_catalog.yml when: openshift_enable_service_catalog | default(true) | bool -- include: ../openshift-management/config.yml +- include: ../../openshift-management/private/config.yml when: openshift_management_install_management | default(false) | bool - name: Print deprecated variable warning message if necessary diff --git a/playbooks/common/openshift-management/add_container_provider.yml b/playbooks/common/openshift-management/add_container_provider.yml deleted file mode 100644 index facb3a5b9..000000000 --- a/playbooks/common/openshift-management/add_container_provider.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Add Container Provider to Management - hosts: oo_first_master - tasks: - - name: Run the Management Integration Tasks - include_role: - name: openshift_management - tasks_from: add_container_provider diff --git a/playbooks/common/openshift-management/config.yml b/playbooks/common/openshift-management/config.yml deleted file mode 100644 index 3f1cdf713..000000000 --- a/playbooks/common/openshift-management/config.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- name: Management Install Checkpoint Start - hosts: all - gather_facts: false - tasks: - - name: Set Management install 'In Progress' - run_once: true - set_stats: - data: - installer_phase_management: - status: "In Progress" - start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" - -- name: Setup CFME - hosts: oo_first_master - pre_tasks: - - name: Create a temporary place to evaluate the PV templates - command: mktemp -d /tmp/openshift-ansible-XXXXXXX - register: r_openshift_management_mktemp - changed_when: false - - tasks: - - name: Run the CFME Setup Role - include_role: - name: openshift_management - vars: - template_dir: "{{ hostvars[groups.masters.0].r_openshift_management_mktemp.stdout }}" - -- name: Management Install Checkpoint End - hosts: all - gather_facts: false - tasks: - - name: Set Management install 'Complete' - run_once: true - set_stats: - data: - installer_phase_management: - status: "Complete" - end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" diff --git a/playbooks/common/openshift-management/filter_plugins b/playbooks/common/openshift-management/filter_plugins deleted file mode 120000 index 99a95e4ca..000000000 --- a/playbooks/common/openshift-management/filter_plugins +++ /dev/null @@ -1 +0,0 @@ -../../../filter_plugins \ No newline at end of file diff --git a/playbooks/common/openshift-management/library b/playbooks/common/openshift-management/library deleted file mode 120000 index ba40d2f56..000000000 --- a/playbooks/common/openshift-management/library +++ /dev/null @@ -1 +0,0 @@ -../../../library \ No newline at end of file diff --git a/playbooks/common/openshift-management/roles b/playbooks/common/openshift-management/roles deleted file mode 120000 index 20c4c58cf..000000000 --- a/playbooks/common/openshift-management/roles +++ /dev/null @@ -1 +0,0 @@ -../../../roles \ No newline at end of file diff --git a/playbooks/common/openshift-management/uninstall.yml b/playbooks/common/openshift-management/uninstall.yml deleted file mode 100644 index 9f35cc276..000000000 --- a/playbooks/common/openshift-management/uninstall.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Uninstall CFME - hosts: masters[0] - tasks: - - name: Run the CFME Uninstall Role Tasks - include_role: - name: openshift_management - tasks_from: uninstall diff --git a/playbooks/openshift-management/add_container_provider.yml b/playbooks/openshift-management/add_container_provider.yml new file mode 100644 index 000000000..9f3834c6a --- /dev/null +++ b/playbooks/openshift-management/add_container_provider.yml @@ -0,0 +1,4 @@ +--- +- include: ../init/evaluate_groups.yml + +- include: private/add_container_provider.yml diff --git a/playbooks/openshift-management/add_many_container_providers.yml b/playbooks/openshift-management/add_many_container_providers.yml new file mode 100644 index 000000000..62fdb11c5 --- /dev/null +++ b/playbooks/openshift-management/add_many_container_providers.yml @@ -0,0 +1,36 @@ +--- +- hosts: localhost + tasks: + - name: Ensure the container provider configuration is defined + assert: + that: container_providers_config is defined + msg: | + Error: Must provide providers config path. Fix: Add '-e container_providers_config=/path/to/your/config' to the ansible-playbook command + + - name: Include providers/management configuration + include_vars: + file: "{{ container_providers_config }}" + + - name: Ensure this cluster is a container provider + uri: + url: "https://{{ management_server['hostname'] }}/api/providers" + body_format: json + method: POST + user: "{{ management_server['user'] }}" + password: "{{ management_server['password'] }}" + validate_certs: no + # Docs on formatting the BODY of the POST request: + # http://manageiq.org/docs/reference/latest/api/reference/providers.html#specifying-connection-configurations + body: "{{ item }}" + failed_when: false + with_items: "{{ container_providers }}" + register: results + + # Include openshift_management for access to filter_plugins. + - include_role: + name: openshift_management + tasks_from: noop + + - name: print each result + debug: + msg: "{{ results.results | oo_filter_container_providers }}" diff --git a/playbooks/openshift-management/config.yml b/playbooks/openshift-management/config.yml new file mode 100644 index 000000000..8ee57ce8d --- /dev/null +++ b/playbooks/openshift-management/config.yml @@ -0,0 +1,4 @@ +--- +- include: ../init/main.yml + +- include: private/config.yml diff --git a/playbooks/openshift-management/private/add_container_provider.yml b/playbooks/openshift-management/private/add_container_provider.yml new file mode 100644 index 000000000..facb3a5b9 --- /dev/null +++ b/playbooks/openshift-management/private/add_container_provider.yml @@ -0,0 +1,8 @@ +--- +- name: Add Container Provider to Management + hosts: oo_first_master + tasks: + - name: Run the Management Integration Tasks + include_role: + name: openshift_management + tasks_from: add_container_provider diff --git a/playbooks/openshift-management/private/config.yml b/playbooks/openshift-management/private/config.yml new file mode 100644 index 000000000..3f1cdf713 --- /dev/null +++ b/playbooks/openshift-management/private/config.yml @@ -0,0 +1,39 @@ +--- +- name: Management Install Checkpoint Start + hosts: all + gather_facts: false + tasks: + - name: Set Management install 'In Progress' + run_once: true + set_stats: + data: + installer_phase_management: + status: "In Progress" + start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" + +- name: Setup CFME + hosts: oo_first_master + pre_tasks: + - name: Create a temporary place to evaluate the PV templates + command: mktemp -d /tmp/openshift-ansible-XXXXXXX + register: r_openshift_management_mktemp + changed_when: false + + tasks: + - name: Run the CFME Setup Role + include_role: + name: openshift_management + vars: + template_dir: "{{ hostvars[groups.masters.0].r_openshift_management_mktemp.stdout }}" + +- name: Management Install Checkpoint End + hosts: all + gather_facts: false + tasks: + - name: Set Management install 'Complete' + run_once: true + set_stats: + data: + installer_phase_management: + status: "Complete" + end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" diff --git a/playbooks/openshift-management/private/filter_plugins b/playbooks/openshift-management/private/filter_plugins new file mode 120000 index 000000000..99a95e4ca --- /dev/null +++ b/playbooks/openshift-management/private/filter_plugins @@ -0,0 +1 @@ +../../../filter_plugins \ No newline at end of file diff --git a/playbooks/openshift-management/private/library b/playbooks/openshift-management/private/library new file mode 120000 index 000000000..ba40d2f56 --- /dev/null +++ b/playbooks/openshift-management/private/library @@ -0,0 +1 @@ +../../../library \ No newline at end of file diff --git a/playbooks/openshift-management/private/roles b/playbooks/openshift-management/private/roles new file mode 120000 index 000000000..20c4c58cf --- /dev/null +++ b/playbooks/openshift-management/private/roles @@ -0,0 +1 @@ +../../../roles \ No newline at end of file diff --git a/playbooks/openshift-management/private/uninstall.yml b/playbooks/openshift-management/private/uninstall.yml new file mode 100644 index 000000000..9f35cc276 --- /dev/null +++ b/playbooks/openshift-management/private/uninstall.yml @@ -0,0 +1,8 @@ +--- +- name: Uninstall CFME + hosts: masters[0] + tasks: + - name: Run the CFME Uninstall Role Tasks + include_role: + name: openshift_management + tasks_from: uninstall diff --git a/playbooks/openshift-management/roles b/playbooks/openshift-management/roles new file mode 120000 index 000000000..b741aa3db --- /dev/null +++ b/playbooks/openshift-management/roles @@ -0,0 +1 @@ +../../roles \ No newline at end of file diff --git a/playbooks/openshift-management/uninstall.yml b/playbooks/openshift-management/uninstall.yml new file mode 100644 index 000000000..3741f4739 --- /dev/null +++ b/playbooks/openshift-management/uninstall.yml @@ -0,0 +1,2 @@ +--- +- include: private/uninstall.yml diff --git a/roles/installer_checkpoint/callback_plugins/installer_checkpoint.py b/roles/installer_checkpoint/callback_plugins/installer_checkpoint.py index 205719215..3772be5d8 100644 --- a/roles/installer_checkpoint/callback_plugins/installer_checkpoint.py +++ b/roles/installer_checkpoint/callback_plugins/installer_checkpoint.py @@ -98,7 +98,7 @@ class CallbackModule(CallbackBase): }, 'installer_phase_management': { 'title': 'Management Install', - 'playbook': 'playbooks/byo/openshift-management/config.yml' + 'playbook': 'playbooks/openshift-management/config.yml' }, } -- cgit v1.2.1