Skip to content

Commit

Permalink
sap_vm_provision: resolve when condition for new byos registration
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-freeman committed May 10, 2024
1 parent 68c0fa3 commit 1f40100
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
11 changes: 8 additions & 3 deletions roles/sap_vm_provision/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,22 @@ sap_vm_provision_dns_root_domain: ""


####
# VM Provision - Generic configuration - Hypervsior
# VM Provision - Generic configuration - Hypervsior or Cloud Hyperscaler OS Images with Bring-Your-Own-Subscription (BYOS)
####

# Register to OS Vendor online subscription to package repositories
sap_vm_provision_os_online_registration_passcode: ""
sap_vm_provision_os_online_registration_user: ""
# sap_vm_provision_os_online_registration_passcode: ""
# sap_vm_provision_os_online_registration_user: ""

# Register to Hosted Mirror of OS Vendor package repositories
# sap_vm_provision_os_registration_ca_file_path: ""
# sap_vm_provision_os_registration_script_command: ""


####
# VM Provision - Generic configuration - Hypervsior
####

# Proxy - Web Forward, when SNAT not available for Hypervisor VMs
# sap_vm_provision_proxy_web_forward_proxy_ip: "" # IP:Port only, no http:// prefix
# sap_vm_provision_proxy_web_forward_exclusions: "localhost,127.0.0.1,{{ sap_vm_provision_dns_root_domain }}"
Expand Down
20 changes: 10 additions & 10 deletions roles/sap_vm_provision/tasks/common/register_os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
when:
- ansible_os_family == 'RedHat'
- (sap_vm_provision_os_registration_script_command is defined) and (sap_vm_provision_os_registration_script_command | length > 0)
- (not sap_vm_provision_os_online_registration_user is defined) or (sap_vm_provision_os_online_registration_user | length == 0)
- (not sap_vm_provision_os_online_registration_passcode is defined) or (sap_vm_provision_os_online_registration_passcode | length == 0)
- (not sap_vm_provision_os_online_registration_user is defined) and (sap_vm_provision_os_online_registration_user | length == 0)
- (not sap_vm_provision_os_online_registration_passcode is defined) and (sap_vm_provision_os_online_registration_passcode | length == 0)
block:

- name: Red Hat Package Repositories - Clean any existing Red Hat Subscription Manager data
Expand Down Expand Up @@ -38,8 +38,8 @@
when:
- ansible_os_family == 'Suse'
- (sap_vm_provision_os_registration_script_command is defined) and (sap_vm_provision_os_registration_script_command | length > 0)
- (not sap_vm_provision_os_online_registration_user is defined) or (sap_vm_provision_os_online_registration_user | length == 0)
- (not sap_vm_provision_os_online_registration_passcode is defined) or (sap_vm_provision_os_online_registration_passcode | length == 0)
- (not sap_vm_provision_os_online_registration_user is defined) and (sap_vm_provision_os_online_registration_user | length == 0)
- (not sap_vm_provision_os_online_registration_passcode is defined) and (sap_vm_provision_os_online_registration_passcode | length == 0)
block:

- name: SUSE Package Repositories - Import CA file for SUSE RMT server
Expand All @@ -65,9 +65,9 @@
- name: Ansible Task block for RHEL Package Repositories setup via Public Internet
when:
- ansible_os_family == 'RedHat'
- (not sap_vm_provision_os_registration_script_command is defined) or (sap_vm_provision_os_registration_script_command | length == 0)
- (sap_vm_provision_os_online_registration_user is defined) or (sap_vm_provision_os_online_registration_user | length > 0)
- (sap_vm_provision_os_online_registration_passcode is defined) or (sap_vm_provision_os_online_registration_passcode | length > 0)
- (not sap_vm_provision_os_registration_script_command is defined) and (sap_vm_provision_os_registration_script_command | length == 0)
- (sap_vm_provision_os_online_registration_user is defined) and (sap_vm_provision_os_online_registration_user | length > 0)
- (sap_vm_provision_os_online_registration_passcode is defined) and (sap_vm_provision_os_online_registration_passcode | length > 0)
block:

- name: Red Hat Customer Portal (RHCP) Online Package Repositories - Execute
Expand All @@ -78,9 +78,9 @@
- name: Ansible Task block for SLES Package Repositories setup via Public Internet
when:
- ansible_os_family == 'Suse'
- (not sap_vm_provision_os_registration_script_command is defined) or (sap_vm_provision_os_registration_script_command | length == 0)
- (sap_vm_provision_os_online_registration_user is defined) or (sap_vm_provision_os_online_registration_user | length > 0)
- (sap_vm_provision_os_online_registration_passcode is defined) or (sap_vm_provision_os_online_registration_passcode | length > 0)
- (not sap_vm_provision_os_registration_script_command is defined) and (sap_vm_provision_os_registration_script_command | length == 0)
- (sap_vm_provision_os_online_registration_user is defined) and (sap_vm_provision_os_online_registration_user | length > 0)
- (sap_vm_provision_os_online_registration_passcode is defined) and (sap_vm_provision_os_online_registration_passcode | length > 0)
block:

- name: SUSE Customer Center (SCC) Online Package Repositories - Execute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@
when:
- ansible_os_family == 'RedHat'
- (not sap_vm_provision_os_registration_script_command is defined) and (not sap_vm_provision_os_registration_script_command | length > 0)
- (not sap_vm_provision_os_online_registration_user is defined) or (sap_vm_provision_os_online_registration_user | length == 0)
- (not sap_vm_provision_os_online_registration_passcode is defined) or (sap_vm_provision_os_online_registration_passcode | length == 0)
- (not sap_vm_provision_os_online_registration_user is defined) and (sap_vm_provision_os_online_registration_user | length == 0)
- (not sap_vm_provision_os_online_registration_passcode is defined) and (sap_vm_provision_os_online_registration_passcode | length == 0)

# Not applicable to the IBM PowerVS Workspace enabled with Power Edge Router (from Q4-2023 onwards)
# Extract the generated command string and activation key from /usr/share, then execute script from /usr/local/bin
Expand All @@ -358,8 +358,8 @@
when:
- ansible_os_family == 'Suse'
- (not sap_vm_provision_os_registration_script_command is defined) and (not sap_vm_provision_os_registration_script_command | length > 0)
- (not sap_vm_provision_os_online_registration_user is defined) or (sap_vm_provision_os_online_registration_user | length == 0)
- (not sap_vm_provision_os_online_registration_passcode is defined) or (sap_vm_provision_os_online_registration_passcode | length == 0)
- (not sap_vm_provision_os_online_registration_user is defined) and (sap_vm_provision_os_online_registration_user | length == 0)
- (not sap_vm_provision_os_online_registration_passcode is defined) and (sap_vm_provision_os_online_registration_passcode | length == 0)

- name: Register Package Repositories for OS Images with Bring-Your-Own-Subscription (BYOS)
ansible.builtin.include_tasks:
Expand Down

0 comments on commit 1f40100

Please sign in to comment.