diff --git a/README.md b/README.md index 47b4d04c..b4d34d42 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ # Ansible-Automated OpenShift Provisioning on KVM on IBM zSystems / LinuxONE The documentation for this project can be found [here](https://ibm.github.io/Ansible-OpenShift-Provisioning/). + +## What's new: + +###Variables renamed: + +####Rename the variable defining the name of the virtual network for clarity. **env.bridge_name** is renamed to **env.vnet_name**. diff --git a/docs/set-variables-group-vars.md b/docs/set-variables-group-vars.md index 16ede278..e8beba33 100644 --- a/docs/set-variables-group-vars.md +++ b/docs/set-variables-group-vars.md @@ -183,7 +183,7 @@ **env.keyboard** | Which keyboard layout would you like Red Hat Enterprise Linux to use? | us **env.ansible_key_name** | (Optional) Name of the SSH key that Ansible will use to connect to hosts. | ansible-ocpz **env.ocp_key_name** | Comment to describe the SSH key used for OCP. Arbitrary value. | OCPZ-01 key -**env.bridge_name** | (Optional) Name of the macvtap bridge that will be created on the KVM host or in case of NAT the name of the NAT network defenition (usually it is 'default'). If NAT is being used and a jumphost is needed, the parameters network_mode, jumphost.name, jumphost.user and jumphost.pass must be specified, too. In case of default (NAT) network verify that the configured IP ranges does not interfere with the IPs defined for the controle and compute nodes. Modify the default network (dhcp range setting) to prevent issues with VMs using dhcp and OCP nodes having fixed IPs.| macvtap-net +**env.vnet_name** | (Optional) Name of the bridged virtual network that will be created on the KVM host if network mode is not set to NAT. In case of NAT network mode the name of the NAT network definition used to create the nodes(usually it is 'default'). If NAT is being used and a jumphost is needed, the parameters network_mode, jumphost.name, jumphost.user and jumphost.pass must be specified, too. For default (NAT) network verify that the configured IP ranges does not interfere with the IPs defined for the controle and compute nodes. Modify the default network (dhcp range setting) to prevent issues with VMs using dhcp and OCP nodes having fixed IPs. Default is create a bridge network.| macvtap-net **env.network_mode** | (Optional) In case the network mode will be NAT and the installation will be executed from remote (e.g. your laptop), a jumphost needs to be defined to let the installation access the bastion host. If macvtap for networking is being used this variable should be empty. | NAT **env.use_ipv6** | If ipv6 addresses should be assigned to the controle and compute nodes, this variable should be true (default) and the matching ipv6 settings should be specified. | True **env.use_dhcp** | If dhcp service should be used to get an IP address, this variable should be true and the matching mac address must be specified. | False diff --git a/inventories/default/group_vars/all.yaml.template b/inventories/default/group_vars/all.yaml.template index afb5336a..1ee2e63c 100644 --- a/inventories/default/group_vars/all.yaml.template +++ b/inventories/default/group_vars/all.yaml.template @@ -211,7 +211,7 @@ env: root_access: false ansible_key_name: ansible-ocpz ocp_ssh_key_comment: OpenShift key - bridge_name: macvtap + vnet_name: macvtap network_mode: use_ipv6: True use_dhcp: False diff --git a/roles/boot_agents_hypershift/tasks/main.yaml b/roles/boot_agents_hypershift/tasks/main.yaml index c4e59cfe..1b808751 100644 --- a/roles/boot_agents_hypershift/tasks/main.yaml +++ b/roles/boot_agents_hypershift/tasks/main.yaml @@ -20,7 +20,7 @@ --vcpus="{{ hypershift.agents_parms.vcpus }}" \ --location "/var/lib/libvirt/images/pxeboot/,kernel=kernel.img,initrd=initrd.img" \ --disk {{ hypershift.agents_parms.storage.pool_path }}{{ hypershift.hcp.hosted_cluster_name }}-agent{{ item }}.qcow2 \ - --network network:{{ env.bridge_name }},mac=$mac_address \ + --network network:{{ env.vnet_name }},mac=$mac_address \ --graphics none \ --noautoconsole \ --wait=-1 \ diff --git a/roles/create_bastion/tasks/main.yaml b/roles/create_bastion/tasks/main.yaml index c0ea62f1..b67e3326 100644 --- a/roles/create_bastion/tasks/main.yaml +++ b/roles/create_bastion/tasks/main.yaml @@ -65,7 +65,7 @@ --vcpus={{ env.bastion.resources.vcpu }} \ --location {{ env.file_server.protocol }}://{{ env.file_server.user + ':' + env.file_server.pass + '@' if env.file_server.protocol == 'ftp' else '' }}{{ env.file_server.ip }}{{ ':' + env.file_server.port if env.file_server.port | default('') | length > 0 else '' }}/{{ env.file_server.iso_mount_dir }} \ --disk pool={{ env.cluster.networking.metadata_name }}-vdisk,size={{ env.bastion.resources.disk_size }} \ - --network network={{ env.bridge_name }}{{ (',mac=' + env.bastion.networking.mac) if (env.bastion.networking.mac is defined and env.use_dhcp) }} \ + --network network={{ env.vnet_name }}{{ (',mac=' + env.bastion.networking.mac) if (env.bastion.networking.mac is defined and env.use_dhcp) }} \ --graphics none \ --console pty,target_type=serial \ --noautoconsole --wait=-1 \ diff --git a/roles/create_bastion_hypershift/tasks/main.yaml b/roles/create_bastion_hypershift/tasks/main.yaml index 667f490c..f19186ca 100644 --- a/roles/create_bastion_hypershift/tasks/main.yaml +++ b/roles/create_bastion_hypershift/tasks/main.yaml @@ -58,7 +58,7 @@ --vcpus sockets=1,cores=4,threads=1 \ --disk {{ hypershift.agents_parms.storage.pool_path }}{{ hypershift.hcp.hosted_cluster_name }}-bastion.qcow2,format=qcow2,bus=virtio,cache=none \ --os-variant "rhel{{hypershift.bastion_parms.os_variant}}" \ - --network network:{{ env.bridge_name }} \ + --network network:{{ env.vnet_name }} \ --location '{{ env.file_server.protocol }}://{{ env.file_server.user + ':' + env.file_server.pass + '@' if env.file_server.protocol == 'ftp' else '' }}{{ env.file_server.ip }}{{ ':' + env.file_server.port if env.file_server.port | default('') | length > 0 else '' }}/{{ env.file_server.iso_mount_dir }}/' \ --rng=/dev/urandom --initrd-inject /home/libvirt/bastion.ks \ --extra-args="ks=file:/bastion.ks ip={{ hypershift.bastion_hypershift }}::{{hypershift.bastion_parms.gateway}}:{{hypershift.bastion_parms.subnet_mask}}:{{ hypershift.bastion_parms.hostname }}.{{ hypershift.bastion_parms.base_domain }}:{{ hypershift.bastion_parms.interface }}:none console=ttysclp0 nameserver={{hypershift.bastion_parms.nameserver}}" \ diff --git a/roles/create_bootstrap/tasks/main.yaml b/roles/create_bootstrap/tasks/main.yaml index 6c72f759..8da88e10 100644 --- a/roles/create_bootstrap/tasks/main.yaml +++ b/roles/create_bootstrap/tasks/main.yaml @@ -14,7 +14,7 @@ --ram {{ env.cluster.nodes.bootstrap.ram }} \ {{ env.cluster.nodes.bootstrap.vcpu_model_option }} \ --vcpus {{ env.cluster.nodes.bootstrap.vcpu }} \ - --network network={{ env.bridge_name }}{{ (',mac=' + env.cluster.nodes.bootstrap.mac) if (env.cluster.nodes.bootstrap.mac is defined and env.use_dhcp) }} \ + --network network={{ env.vnet_name }}{{ (',mac=' + env.cluster.nodes.bootstrap.mac) if (env.cluster.nodes.bootstrap.mac is defined and env.use_dhcp) }} \ --location {{ rhcos_download_url }},kernel={{ rhcos_live_kernel }},initrd={{ rhcos_live_initrd }} \ --extra-args "rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda" \ --extra-args "coreos.live.rootfs_url=http://{{ env.bastion.networking.ip }}:8080/bin/{{ rhcos_live_rootfs }}" \ diff --git a/roles/create_compute_node/tasks/main.yaml b/roles/create_compute_node/tasks/main.yaml index 7df6c4b0..ca395e6c 100644 --- a/roles/create_compute_node/tasks/main.yaml +++ b/roles/create_compute_node/tasks/main.yaml @@ -62,7 +62,7 @@ --ram {{ env.cluster.nodes.compute.ram }} \ ${CPU_MODEL} \ --vcpus {{ env.cluster.nodes.compute.vcpu }} \ - --network network={{ env.bridge_name }}{{ (',mac=' + param_compute_node.vm_mac) if (param_compute_node.vm_mac is defined and env.use_dhcp) }} \ + --network network={{ env.vnet_name }}{{ (',mac=' + param_compute_node.vm_mac) if (param_compute_node.vm_mac is defined and env.use_dhcp) }} \ --graphics none \ --console pty,target_type=serial \ --wait -1 \ diff --git a/roles/create_compute_nodes/tasks/main.yaml b/roles/create_compute_nodes/tasks/main.yaml index 694130ac..0f4e06db 100644 --- a/roles/create_compute_nodes/tasks/main.yaml +++ b/roles/create_compute_nodes/tasks/main.yaml @@ -13,7 +13,7 @@ --ram {{ env.cluster.nodes.compute.ram }} \ {{ env.cluster.nodes.compute.vcpu_model_option }} \ --vcpus {{ env.cluster.nodes.compute.vcpu }} \ - --network network={{ env.bridge_name }}{{ (',mac=' + env.cluster.nodes.compute.mac[i]) if (env.cluster.nodes.compute.mac[i] is defined and env.use_dhcp) }} \ + --network network={{ env.vnet_name }}{{ (',mac=' + env.cluster.nodes.compute.mac[i]) if (env.cluster.nodes.compute.mac[i] is defined and env.use_dhcp) }} \ --location {{ rhcos_download_url }},kernel={{ rhcos_live_kernel }},initrd={{ rhcos_live_initrd }} \ --extra-args "rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda" \ --extra-args "coreos.live.rootfs_url=http://{{ env.bastion.networking.ip }}:8080/bin/{{ rhcos_live_rootfs }}" \ @@ -47,7 +47,7 @@ --ram {{ env.cluster.nodes.infra.ram }} \ {{ env.cluster.nodes.infra.vcpu_model_option }} \ --vcpus {{ env.cluster.nodes.infra.vcpu }} \ - --network network={{ env.bridge_name }} \ + --network network={{ env.vnet_name }} \ --location {{ rhcos_download_url }},kernel={{ rhcos_live_kernel }},initrd={{ rhcos_live_initrd }} \ --extra-args "rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda" \ --extra-args "coreos.live.rootfs_url=http://{{ env.bastion.networking.ip }}:8080/bin/{{ rhcos_live_rootfs }}" \ @@ -96,7 +96,7 @@ --ram {{ env.cluster.nodes.compute.ram }} \ {{ env.cluster.nodes.compute.vcpu_model_option }} \ --vcpus {{ env.cluster.nodes.compute.vcpu }} \ - --network network={{ env.bridge_name }}{{ (',mac=' + compute_mac[i] if (compute_mac[i] is defined and env.use_dhcp) }} \ + --network network={{ env.vnet_name }}{{ (',mac=' + compute_mac[i] if (compute_mac[i] is defined and env.use_dhcp) }} \ --location {{ rhcos_download_url }},kernel={{ rhcos_live_kernel }},initrd={{ rhcos_live_initrd }} \ --extra-args "rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda" \ --extra-args "coreos.live.rootfs_url=http://{{ env.bastion.networking.ip }}:8080/bin/{{ rhcos_live_rootfs }}" \ @@ -129,7 +129,7 @@ --ram {{ env.cluster.nodes.infra.ram }} \ {{ env.cluster.nodes.infra.vcpu_model_option }} \ --vcpus {{ env.cluster.nodes.infra.vcpu }} \ - --network network={{ env.bridge_name }} \ + --network network={{ env.vnet_name }} \ --location {{ rhcos_download_url }},kernel={{ rhcos_live_kernel }},initrd={{ rhcos_live_initrd }} \ --extra-args "rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda" \ --extra-args "coreos.live.rootfs_url=http://{{ env.bastion.networking.ip }}:8080/bin/{{ rhcos_live_rootfs }}" \ diff --git a/roles/create_control_nodes/tasks/main.yaml b/roles/create_control_nodes/tasks/main.yaml index 1cb51189..1c549647 100644 --- a/roles/create_control_nodes/tasks/main.yaml +++ b/roles/create_control_nodes/tasks/main.yaml @@ -11,7 +11,7 @@ --ram {{ env.cluster.nodes.control.ram }} \ {{ env.cluster.nodes.control.vcpu_model_option }} \ --vcpus {{ env.cluster.nodes.control.vcpu }} \ - --network network={{ env.bridge_name }}{{ (',mac=' + env.cluster.nodes.control.mac[i]) if (env.cluster.nodes.control.mac[i] is defined and env.use_dhcp) }} \ + --network network={{ env.vnet_name }}{{ (',mac=' + env.cluster.nodes.control.mac[i]) if (env.cluster.nodes.control.mac[i] is defined and env.use_dhcp) }} \ --location {{ rhcos_download_url }},kernel={{ rhcos_live_kernel }},initrd={{ rhcos_live_initrd }} \ --extra-args "rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda" \ --extra-args "coreos.live.rootfs_url=http://{{ env.bastion.networking.ip }}:8080/bin/{{ rhcos_live_rootfs }}" \ @@ -48,7 +48,7 @@ --ram {{ env.cluster.nodes.control.ram }} \ {{ env.cluster.nodes.control.vcpu_model_option }} \ --vcpus {{ env.cluster.nodes.control.vcpu }} \ - --network network={{ env.bridge_name }}{{ (',mac=' + env.cluster.nodes.control.mac[0]) if (env.cluster.nodes.control.mac[0] is defined and env.use_dhcp) }} \ + --network network={{ env.vnet_name }}{{ (',mac=' + env.cluster.nodes.control.mac[0]) if (env.cluster.nodes.control.mac[0] is defined and env.use_dhcp) }} \ --location {{ rhcos_download_url }},kernel={{ rhcos_live_kernel }},initrd={{ rhcos_live_initrd }} \ --extra-args "rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda" \ --extra-args "coreos.live.rootfs_url=http://{{ env.bastion.networking.ip }}:8080/bin/{{ rhcos_live_rootfs }}" \ @@ -78,7 +78,7 @@ --ram {{ env.cluster.nodes.control.ram }} \ {{ env.cluster.nodes.control.vcpu_model_option }} \ --vcpus {{ env.cluster.nodes.control.vcpu }} \ - --network network={{ env.bridge_name }}{{ (',mac=' + env.cluster.nodes.control.mac[1]) if (env.cluster.nodes.control.mac[1] is defined and env.use_dhcp) }} \ + --network network={{ env.vnet_name }}{{ (',mac=' + env.cluster.nodes.control.mac[1]) if (env.cluster.nodes.control.mac[1] is defined and env.use_dhcp) }} \ --location {{ rhcos_download_url }},kernel={{ rhcos_live_kernel }},initrd={{ rhcos_live_initrd }} \ --extra-args "rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda" \ --extra-args "coreos.live.rootfs_url=http://{{ env.bastion.networking.ip }}:8080/bin/{{ rhcos_live_rootfs }}" \ @@ -108,7 +108,7 @@ --ram {{ env.cluster.nodes.control.ram }} \ {{ env.cluster.nodes.control.vcpu_model_option }} \ --vcpus {{ env.cluster.nodes.control.vcpu }} \ - --network network={{ env.bridge_name }}{{ (',mac=' + env.cluster.nodes.control.mac[2]) if (env.cluster.nodes.control.mac[2] is defined and env.use_dhcp) }} \ + --network network={{ env.vnet_name }}{{ (',mac=' + env.cluster.nodes.control.mac[2]) if (env.cluster.nodes.control.mac[2] is defined and env.use_dhcp) }} \ --location {{ rhcos_download_url }},kernel={{ rhcos_live_kernel }},initrd={{ rhcos_live_initrd }} \ --extra-args "rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda" \ --extra-args "coreos.live.rootfs_url=http://{{ env.bastion.networking.ip }}:8080/bin/{{ rhcos_live_rootfs }}" \ diff --git a/roles/macvtap/tasks/main.yaml b/roles/macvtap/tasks/main.yaml index 98f1cac9..86f6f649 100644 --- a/roles/macvtap/tasks/main.yaml +++ b/roles/macvtap/tasks/main.yaml @@ -4,17 +4,17 @@ tags: macvtap community.libvirt.virt_net: command: define - name: "{{ env.bridge_name }}" + name: "{{ env.vnet_name }}" xml: "{{ lookup ('template', 'macvtap.xml.j2') }}" - name: Start macvtap bridge tags: macvtap community.libvirt.virt_net: command: start - name: "{{ env.bridge_name }}" + name: "{{ env.vnet_name }}" - name: Set macvtap bridge to autostart tags: macvtap community.libvirt.virt_net: autostart: yes - name: "{{ env.bridge_name }}" + name: "{{ env.vnet_name }}" diff --git a/roles/macvtap/templates/macvtap.xml.j2 b/roles/macvtap/templates/macvtap.xml.j2 index a4857e24..e69fd198 100644 --- a/roles/macvtap/templates/macvtap.xml.j2 +++ b/roles/macvtap/templates/macvtap.xml.j2 @@ -1,5 +1,5 @@ - {{ env.bridge_name }} + {{ env.vnet_name }}