Skip to content

Commit

Permalink
Merge pull request #26 from sean-freeman/dev
Browse files Browse the repository at this point in the history
sap_vm_provision: append byos to all cloud targets
  • Loading branch information
sean-freeman authored May 9, 2024
2 parents ce104ae + 68c0fa3 commit 7a85e53
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 8 deletions.
8 changes: 4 additions & 4 deletions roles/sap_vm_provision/tasks/common/register_os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#### For On-Premise Package Repo Mirrors ####

- name: Ansible Task block for RHEL Package Repositories setup
- name: Ansible Task block for RHEL Package Repositories setup with Registration Script
when:
- ansible_os_family == 'RedHat'
- (sap_vm_provision_os_registration_script_command is defined) and (sap_vm_provision_os_registration_script_command | length > 0)
Expand Down Expand Up @@ -34,7 +34,7 @@
ansible.builtin.command: dnf clean all


- name: Ansible Task block for SLES Package Repositories setup
- name: Ansible Task block for SLES Package Repositories setup with Registration Script
when:
- ansible_os_family == 'Suse'
- (sap_vm_provision_os_registration_script_command is defined) and (sap_vm_provision_os_registration_script_command | length > 0)
Expand Down Expand Up @@ -62,7 +62,7 @@

#### For Online Registration via SNAT ####

- name: Ansible Task block for RHEL Online Package Repositories setup
- 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)
Expand All @@ -75,7 +75,7 @@
ignore_errors: true


- name: Ansible Task block for SLES Online Package Repositories setup
- 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,11 @@
ansible.builtin.include_tasks:
file: common/set_ansible_vars_storage.yml

- name: Register Package Repositories
- name: Register Package Repositories for OS Images with Bring-Your-Own-Subscription (BYOS)
ansible.builtin.include_tasks:
file: common/register_os.yml


- name: Ansible Task block for provisioning of High Availability resources for AWS EC2 instances
delegate_to: localhost
any_errors_fatal: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@
ansible.builtin.include_tasks:
file: common/set_ansible_vars_storage.yml

- name: Register Package Repositories for OS Images with Bring-Your-Own-Subscription (BYOS)
ansible.builtin.include_tasks:
file: common/register_os.yml


- name: Ansible Task block to execute on target inventory hosts - High Availability
delegate_to: "{{ inventory_hostname }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,11 @@
set -o pipefail && if [ "${workspace_legacy_cc}" = true ]; then activation_script_exec=$(cat /usr/share/powervs-fls/powervs-fls-readme.md | grep networklayer.com | sed "s|Private.proxy.IP.address:3128|$web_proxy_ip_port|" | sed 's|. ||') ; fi
set -o pipefail && if [ "${workspace_legacy_cc}" = true ]; then nohup $activation_script_exec >/dev/null 2>&1 ; fi
set -o pipefail && if [ "${workspace_legacy_cc}" = true ]; then sleep 120 ; fi
when: ansible_os_family == "RedHat"
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 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 @@ -351,7 +355,15 @@
set -o pipefail && if [ "${workspace_legacy_cc}" = true ]; then nohup $activation_script_exec >/dev/null 2>&1 ; fi
set -o pipefail && if [ "${workspace_legacy_cc}" = true ]; then sleep 120 ; fi
set -o pipefail && SUSEConnect --product PackageHub/{{ ansible_distribution_version }}/ppc64le
when: ansible_os_family == "Suse"
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)

- name: Register Package Repositories for OS Images with Bring-Your-Own-Subscription (BYOS)
ansible.builtin.include_tasks:
file: common/register_os.yml

- name: Verify connection to NFS
ansible.builtin.wait_for:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@
ansible.builtin.include_tasks:
file: common/set_ansible_vars_storage.yml

- name: Register Package Repositories for OS Images with Bring-Your-Own-Subscription (BYOS)
ansible.builtin.include_tasks:
file: common/register_os.yml


# - name: Ansible Task block to execute on target inventory hosts - High Availability
# delegate_to: "{{ inventory_hostname }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@

# Workaround for bug which populates region and ibmcloud_api_key as TF arguments for ibm_is_lbs_info Ansible Module in legacy Ansible Collection
- name: IBM Cloud CLI execution to list Load Balancer/s info
no_log: "{{ __sap_vm_provision_no_log }}"
register: __sap_vm_provision_task_ibmcloud_lb_all_info_shell
ansible.builtin.shell: |
ibmcloud config --quiet --check-version false && ibmcloud login -g {{ sap_vm_provision_ibmcloud_resource_group_name }} -r {{ sap_vm_provision_ibmcloud_region }} --quiet
ibmcloud config --quiet --check-version false && ibmcloud login --apikey="{{ sap_vm_provision_ibmcloud_api_key }}" -g {{ sap_vm_provision_ibmcloud_resource_group_name }} -r {{ sap_vm_provision_ibmcloud_region }} --quiet
#ibmcloud plugin install infrastructure-service -f --quiet
ibmcloud is load-balancers --quiet --output json
Expand Down

0 comments on commit 7a85e53

Please sign in to comment.