Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sap_vm_provision: os image consistency update and ibmcloud features #69

Merged
merged 14 commits into from
Nov 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
sap_vm_provision: append ibmcloud vni feature
sean-freeman committed Nov 23, 2024
commit 53768a2b1c45f09fef425d928d254288f0c7dbe2
Original file line number Diff line number Diff line change
@@ -116,7 +116,7 @@
ansible.builtin.add_host:
name: "{{ add_item[0].host_node }}"
groups: "{{ add_item[0].sap_system_type + '_' if (add_item[0].sap_system_type != '') }}{{ add_item[0].sap_host_type }}"
ansible_host: "{{ add_item[0].resource.primary_network_interface[0].primary_ipv4_address }}"
ansible_host: "{{ add_item[0].resource.primary_network_attachment[0].virtual_network_interface[0].primary_ip[0].address }}"
ansible_user: "root"
ansible_ssh_private_key_file: "{{ sap_vm_provision_ssh_host_private_key_file_path }}"
ansible_ssh_common_args: -o ConnectTimeout=180 -o ControlMaster=auto -o ControlPersist=3600s -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ForwardX11=no -o ProxyCommand='ssh -W %h:%p {{ sap_vm_provision_bastion_user }}@{{ sap_vm_provision_bastion_public_ip }} -p {{ sap_vm_provision_bastion_ssh_port }} -i {{ sap_vm_provision_ssh_bastion_private_key_file_path }} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
Original file line number Diff line number Diff line change
@@ -33,15 +33,30 @@
zone: "{{ sap_vm_provision_ibmcloud_availability_zone }}"
vpc: "{{ __sap_vm_provision_task_ibmcloud_vpc_subnet.resource.vpc }}"

# The Subnet assigned to the primary Virtual Network Interface (vNIC) cannot be changed
# The Name and Security Group assigned to the Primary Network Interface (vNIC) are editable
primary_network_interface:
- name: "{{ inventory_hostname }}-vnic0"
subnet: "{{ __sap_vm_provision_task_ibmcloud_vpc_subnet.resource.id }}"
allow_ip_spoofing: "{{ target_provision_host_spec.disable_ip_anti_spoofing }}" # When disable the Anti IP Spoofing = true, then Allow IP Spoofing = true
security_groups: "{{ __sap_vm_provision_task_ibmcloud_vpc_sg.results | map(attribute='resource.id') }}"
# The Subnet assigned to the deprecated primary Virtual Network Interface (vNIC) cannot be changed
# The Name and Security Group assigned are editable
# primary_network_interface:
# - name: "{{ inventory_hostname }}-vnic0"
# subnet: "{{ __sap_vm_provision_task_ibmcloud_vpc_subnet.resource.id }}"
# allow_ip_spoofing: "{{ target_provision_host_spec.disable_ip_anti_spoofing }}" # When disable the Anti IP Spoofing = true, then Allow IP Spoofing = true
# security_groups: "{{ __sap_vm_provision_task_ibmcloud_vpc_sg.results | map(attribute='resource.id') }}"
#network_interfaces:

# The Subnet assigned to the primary Virtual Network Interface (VNI) cannot be changed
# The Name and Security Group assigned are editable
primary_network_attachment:
- name: "{{ inventory_hostname }}-vni0-attach"
virtual_network_interface:
- name: "{{ inventory_hostname }}-vni0"
resource_group: "{{ __sap_vm_provision_task_ibmcloud_resource_group.resource.id }}"
subnet: "{{ __sap_vm_provision_task_ibmcloud_vpc_subnet.resource.id }}"
security_groups: "{{ __sap_vm_provision_task_ibmcloud_vpc_sg.results | map(attribute='resource.id') }}"
allow_ip_spoofing: "{{ target_provision_host_spec.disable_ip_anti_spoofing }}" # When disable the Anti IP Spoofing = true, then Allow IP Spoofing = true
enable_infrastructure_nat: true # must be true as Virtual Server instances require Infrastructure NAT
protocol_state_filtering_mode: "auto"
auto_delete: true # if VNI created separately, must be false
#network_attachments:

auto_delete_volume: true
boot_volume:
- name: "{{ inventory_hostname }}-boot-0"
@@ -143,7 +158,7 @@

- name: Create fact for delegate host IP
ansible.builtin.set_fact:
provisioned_private_ip: "{{ __sap_vm_provision_task_provision_host_single.resource.primary_network_interface[0].primary_ipv4_address }}"
provisioned_private_ip: "{{ __sap_vm_provision_task_provision_host_single.resource.primary_network_attachment[0].virtual_network_interface[0].primary_ip[0].address }}"


- name: Copy facts to delegate host
@@ -155,7 +170,7 @@
delegate_sap_vm_provision_bastion_ssh_port: "{{ sap_vm_provision_bastion_ssh_port }}"
delegate_sap_vm_provision_ssh_bastion_private_key_file_path: "{{ sap_vm_provision_ssh_bastion_private_key_file_path }}"
delegate_sap_vm_provision_ssh_host_private_key_file_path: "{{ sap_vm_provision_ssh_host_private_key_file_path }}"
delegate_private_ip: "{{ __sap_vm_provision_task_provision_host_single.resource.primary_network_interface[0].primary_ipv4_address }}"
delegate_private_ip: "{{ __sap_vm_provision_task_provision_host_single.resource.primary_network_attachment[0].virtual_network_interface[0].primary_ip[0].address }}"
delegate_hostname: "{{ inventory_hostname }}"
delegate_sap_vm_provision_dns_root_domain_name: "{{ sap_vm_provision_dns_root_domain }}"

Loading