From f3741a05097f1848d2b3e9a01f03e76a33487e01 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Mon, 9 Oct 2017 16:14:38 -0400 Subject: Management Cleanup and Provider Integration * Add container provider integration * General cleanup * Poll until service fully starts * Add notes on multiple-provider additions --- playbooks/byo/openshift-management/add_container_provider.yml | 6 ++++++ playbooks/byo/openshift-management/uninstall.yml | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 playbooks/byo/openshift-management/add_container_provider.yml (limited to 'playbooks/byo') diff --git a/playbooks/byo/openshift-management/add_container_provider.yml b/playbooks/byo/openshift-management/add_container_provider.yml new file mode 100644 index 000000000..3378b5abd --- /dev/null +++ b/playbooks/byo/openshift-management/add_container_provider.yml @@ -0,0 +1,6 @@ +--- +- include: ../openshift-cluster/initialize_groups.yml + +- include: ../../common/openshift-cluster/evaluate_groups.yml + +- include: ../../common/openshift-management/add_container_provider.yml diff --git a/playbooks/byo/openshift-management/uninstall.yml b/playbooks/byo/openshift-management/uninstall.yml index a1fb1cdc4..e95c1c88a 100644 --- a/playbooks/byo/openshift-management/uninstall.yml +++ b/playbooks/byo/openshift-management/uninstall.yml @@ -1,4 +1,2 @@ --- -# - include: ../openshift-cluster/initialize_groups.yml - - include: ../../common/openshift-management/uninstall.yml -- cgit v1.2.3 From 6c3a0373e1a48f730e9a279a255c0f1a58613cc7 Mon Sep 17 00:00:00 2001 From: Andrew Butcher Date: Fri, 20 Oct 2017 15:44:11 -0400 Subject: Move add_many_container_providers.yml to playbooks/byo/openshift-management with a noop task include to load filter plugins. --- .../add_many_container_providers.yml | 46 ++++++++++++++++++++++ playbooks/byo/openshift-management/roles | 1 + 2 files changed, 47 insertions(+) create mode 100644 playbooks/byo/openshift-management/add_many_container_providers.yml create mode 120000 playbooks/byo/openshift-management/roles (limited to 'playbooks/byo') diff --git a/playbooks/byo/openshift-management/add_many_container_providers.yml b/playbooks/byo/openshift-management/add_many_container_providers.yml new file mode 100644 index 000000000..3ab20b94c --- /dev/null +++ b/playbooks/byo/openshift-management/add_many_container_providers.yml @@ -0,0 +1,46 @@ +--- +- 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 + + # TODO: Make this prettier and easier to read + - name: Save results + copy: + dest: /tmp/results.json + content: "{{ results.results | to_nice_json }}" + # state: present + # debug: + # var: item.item + # with_items: "{{ results.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/roles b/playbooks/byo/openshift-management/roles new file mode 120000 index 000000000..20c4c58cf --- /dev/null +++ b/playbooks/byo/openshift-management/roles @@ -0,0 +1 @@ +../../../roles \ No newline at end of file -- cgit v1.2.3 From ac62ea0066934877f94e99bda6ec53a9c03ababb Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Fri, 20 Oct 2017 16:17:41 -0400 Subject: Fix lint --- .../byo/openshift-management/add_many_container_providers.yml | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'playbooks/byo') diff --git a/playbooks/byo/openshift-management/add_many_container_providers.yml b/playbooks/byo/openshift-management/add_many_container_providers.yml index 3ab20b94c..62fdb11c5 100644 --- a/playbooks/byo/openshift-management/add_many_container_providers.yml +++ b/playbooks/byo/openshift-management/add_many_container_providers.yml @@ -26,16 +26,6 @@ with_items: "{{ container_providers }}" register: results - # TODO: Make this prettier and easier to read - - name: Save results - copy: - dest: /tmp/results.json - content: "{{ results.results | to_nice_json }}" - # state: present - # debug: - # var: item.item - # with_items: "{{ results.results }}" - # Include openshift_management for access to filter_plugins. - include_role: name: openshift_management -- cgit v1.2.3