diff --git a/roles/sap_vm_provision/defaults/main.yml b/roles/sap_vm_provision/defaults/main.yml index ecb4224..981b368 100644 --- a/roles/sap_vm_provision/defaults/main.yml +++ b/roles/sap_vm_provision/defaults/main.yml @@ -176,6 +176,7 @@ sap_vm_provision_ibmcloud_placement_resource_name: "sap-placement-group-spread" sap_vm_provision_ibmcloud_placement_strategy_spread: false # IBM Cloud, addendum for IBM Power VS +sap_vm_provision_ibmcloud_private_dns_custom_resolver_ip: "" sap_vm_provision_ibmcloud_powervs_location: "" sap_vm_provision_ibmcloud_powervs_workspace_name: "" sap_vm_provision_ibmcloud_powervs_vlan_subnet_name: "" diff --git a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_main.yml b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_main.yml index 79f033e..0b8a643 100644 --- a/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_main.yml +++ b/roles/sap_vm_provision/tasks/platform_ansible/ibmcloud_powervs/execute_main.yml @@ -156,6 +156,21 @@ instance_id: "{{ __sap_vm_provision_task_ibmcloud_pdns_service_instance.resource.guid }}" ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" + - name: Identify IBM Cloud Private DNS Custom Resolvers info + no_log: "{{ __sap_vm_provision_no_log }}" + register: __sap_vm_provision_task_ibmcloud_pdns_custom_resolvers + run_once: true + ibm.cloudcollection.ibm_dns_custom_resolvers_info: + instance_id: "{{ __sap_vm_provision_task_ibmcloud_pdns_service_instance.resource.guid }}" + ibmcloud_api_key: "{{ sap_vm_provision_ibmcloud_api_key }}" + + - name: Check if input IBM Cloud Private DNS Customer Resolver IP exists + ansible.builtin.fail: + msg: + IBM Cloud Private DNS instance does not contain the input Custom Resolver IP Address. + Please create a Custom Resolver in this IBM Cloud Private DNS instance. + when: not sap_vm_provision_ibmcloud_private_dns_customer_resolver_ip in (__sap_vm_provision_task_ibmcloud_pdns_custom_resolvers.resource.custom_resolvers | map(attribute='locations') | list | flatten | map(attribute='dns_server_ip') | list) + - name: Identify IBM Power Infrastructure OS Catalog Stock Image list no_log: "{{ __sap_vm_provision_no_log }}" register: __sap_vm_provision_task_ibmcloud_pi_os_image_list @@ -376,7 +391,7 @@ - name: Append IBM Cloud Private DNS to /etc/resolv.conf ansible.builtin.lineinfile: path: /etc/resolv.conf - line: nameserver 161.26.0.10 + line: nameserver {{ sap_vm_provision_ibmcloud_private_dns_custom_resolver_ip }} # Required Web Forward Proxy # For IBM PowerVS Workspace enabled with Power Edge Router (from Q4-2023 onwards),