Updated to setup multiple orgs and environments.
diff --git a/defaults/main.yml b/defaults/main.yml
index eb77c93..d83f781 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -4,3 +4,6 @@
create_org: "{{ apigee_bin }}/create-org.sh"
create_roles: "{{ apigee_bin }}/create-roles.sh"
add_env: "{{ apigee_bin }}/add-env.sh"
+
+tenants:
+- { org: opdk, env: test, new_user: 'y' }
diff --git a/tasks/main.yml b/tasks/main.yml
index cc4ee56..6614b82 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -16,29 +16,15 @@
msg: "Management server is not running"
when: ms_ext_mgmt_port_status | failed
-#- include: with_no_proxy.yml
-# when: (https_proxy is not defined or https_proxy | trim == '') and (http_proxy is not defined or http_proxy | trim == '')
-#
-#- include: with_proxy.yml
-# when: https_proxy is defined and https_proxy | trim != '' and http_proxy is defined and http_proxy | trim != ''
-
- name: Apigee provision installation with proxy
shell: '{{ apigee_service }} apigee-provision install'
-# when: not apigee_provision_status.stat.exists
environment:
no_proxy: "{{ no_proxy }}"
http_proxy: "{{ http_proxy }}"
https_proxy: "{{ https_proxy }}"
-- name: Apigee organization setup with proxy
- shell: '{{ apigee_service }} apigee-provision setup-org -f {{ onboarding_config_file_path }}'
-# ignore_errors: yes
- environment:
- no_proxy: "{{ no_proxy }}"
- http_proxy: "{{ http_proxy }}"
- https_proxy: "{{ https_proxy }}"
-
-
-- name: Apigee organization setup with no proxy
- shell: '{{ apigee_service }} apigee-provision setup-org -f {{ onboarding_config_file_path }}'
- ignore_errors: yes
+- name: Iterate over Orgs and Envs
+ include_tasks: setup-org.yml
+ with_items: "{{ tenants }}"
+ loop_control:
+ loop_var: tenant
diff --git a/tasks/setup-org.yml b/tasks/setup-org.yml
new file mode 100644
index 0000000..c9c91b9
--- /dev/null
+++ b/tasks/setup-org.yml
@@ -0,0 +1,23 @@
+---
+- name: Set local attributes
+ set_fact:
+ org_name: "{{ tenant.org }}"
+ env_name: "{{ tenant.env }}"
+ new_user: "{{ tenant.new_user }}"
+
+- name: Update Status Attributes
+ tags: ['status']
+ include_role:
+ name: apigee-opdk-setup-status
+
+- name: Create provisioning file
+ tags: ['org-config']
+ include_role:
+ name: apigee-opdk-setup-org-config
+
+- name: Apigee organization setup with proxy
+ shell: '{{ apigee_service }} apigee-provision setup-org -f {{ onboarding_config_file_path }}'
+ environment:
+ no_proxy: "{{ no_proxy }}"
+ http_proxy: "{{ http_proxy }}"
+ https_proxy: "{{ https_proxy }}"
diff --git a/tasks/with_no_proxy.yml b/tasks/with_no_proxy.yml
deleted file mode 100644
index d8573d0..0000000
--- a/tasks/with_no_proxy.yml
+++ /dev/null
@@ -1,18 +0,0 @@
----
-#- name: Obtain apigee-provision status
-# stat:
-# path: '{{ apigee_provision_dir }}'
-# register: apigee_provision_status
-
-#- name: Ensure apigee-provision is current by uninstalling this first with no proxy
-# ignore_errors: yes
-# shell: '{{ apigee_service }} apigee-provision uninstall'
-# when: apigee_provision_status.stat.exists
-
-- name: Apigee provision installation with no proxy
- shell: '{{ apigee_service }} apigee-provision install'
-# when: not apigee_provision_status.stat.exists
-
-- name: Apigee organization setup with no proxy
- shell: '{{ apigee_service }} apigee-provision setup-org -f {{ onboarding_config_file_path }}'
-# ignore_errors: yes
diff --git a/tasks/with_proxy.yml b/tasks/with_proxy.yml
deleted file mode 100644
index 7078a0a..0000000
--- a/tasks/with_proxy.yml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-#- name: Obtain apigee-provision status
-# stat:
-# path: '{{ apigee_provision_dir }}'
-# register: apigee_provision_status
-
-#- name: Ensure apigee-provision is current by uninstalling this first with proxy
-# ignore_errors: yes
-# shell: '{{ apigee_service }} apigee-provision uninstall'
-# when: not apigee_provision_status.stat.exists
-# environment:
-# no_proxy: "{{ no_proxy }}"
-# http_proxy: "{{ http_proxy }}"
-# https_proxy: "{{ https_proxy }}"
-
-- name: Apigee provision installation with proxy
- shell: '{{ apigee_service }} apigee-provision install'
-# when: not apigee_provision_status.stat.exists
- environment:
- no_proxy: "{{ no_proxy }}"
- http_proxy: "{{ http_proxy }}"
- https_proxy: "{{ https_proxy }}"
-
-- name: Apigee organization setup with proxy
- shell: '{{ apigee_service }} apigee-provision setup-org -f {{ onboarding_config_file_path }}'
-# ignore_errors: yes
- environment:
- no_proxy: "{{ no_proxy }}"
- http_proxy: "{{ http_proxy }}"
- https_proxy: "{{ https_proxy }}"