Skip to content

Commit 6ece51e

Browse files
makirilloybed
andauthored
Remove ipa_host variable from manage-participants (#94)
* Remove ipa_host variable from manage-participants The ipa_host variable should be set at main entry point based on ocp_subdomain and subdomain_base_suffix variables provided externally. * Adding checks for ocp_subdomain and subdomain_base_suffix vars * Adding additional information to the variables check - Adding empty check for ocp_subdomain and subdomain_base_suffix variables - Additional output for error message * Minor formatting update Co-authored-by: Øystein Bedin <[email protected]>
1 parent 8b00aa2 commit 6ece51e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

inventory-generation/identity-management/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
- name: "Set Identity Provider facts"
8585
set_fact:
8686
idp_type: "{{ idp_type | default('idm') }}"
87-
ipa_host: "{{ idp_host_url if idp_host_url is defined else 'ipa.apps.' + (hosting_environments[0].ocp_sub_domain | lower) + '.' + engagement_region | default('dev') + '-1.' + ocp_base_url }}"
8887
ipa_admin_user: "{{ ocp_admin_username }}"
8988
ipa_admin_password: "{{ ocp_admin_password }}"
9089
ipa_validate_certs: "{{ ipa_validate_certs | default(true) }}"
@@ -99,7 +98,6 @@
9998
project_name: "{{ project_name }}"
10099
ocp_subdomain: "{{ hosting_environments[0].ocp_sub_domain | lower }}"
101100
ipa_validate_certs: "{{ ipa_validate_certs }}"
102-
ipa_host: "{{ ipa_host }}"
103101
ipa_admin_user: "{{ ipa_admin_user }}"
104102
ipa_admin_password: "{{ ipa_admin_password }}"
105103
list_of_mail_cc: "{{ cc_list }}"

manage-participants/main.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
- hosts: identity-hosts
44
name: Verify Identity Provider
55
tasks:
6+
- name: "Fail if ocp_subdomain or subdomain_base_suffix not provided"
7+
fail:
8+
msg: "Variable ocp_subdomain ({{ ocp_subdomain | default('')}}) or subdomain_base_suffix ({{ subdomain_base_suffix | default('') }}) is not defined or empty"
9+
when:
10+
- (ocp_subdomain is undefined or ocp_subdomain|trim == "") or
11+
(subdomain_base_suffix is undefined or subdomain_base_suffix|trim == "")
12+
13+
- set_fact:
14+
ipa_host: "ipa.apps.{{ ocp_subdomain }}.{{ subdomain_base_suffix }}"
615

716
- name: Wait for IdM to be responsive
817
uri:
@@ -12,8 +21,6 @@
1221
until: rc.status|trim|int == 200
1322
retries: 90
1423
delay: 60
15-
when:
16-
- ipa_host is defined
1724

1825
- name: Remove participants from IdM
1926
import_playbook: "process_remove.yml"

0 commit comments

Comments
 (0)