Skip to content

Commit

Permalink
sap_vm_provision: add private dns custom resolver to ibm powervs
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-freeman committed Nov 23, 2024
1 parent 53768a2 commit b3b487f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions roles/sap_vm_provision/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit b3b487f

Please sign in to comment.