- name: Set hostname ansible.builtin.hostname: name: "{{ vapp['guestinfo.hostname'] }}" - name: Create netplan configuration file ansible.builtin.template: src: netplan.j2 dest: /etc/netplan/00-installer-config.yaml vars: _template: macaddress: "{{ ansible_facts.default_ipv4.macaddress }}" ipaddress: "{{ vapp['guestinfo.ipaddress'] }}" prefixlength: "{{ vapp['guestinfo.prefixlength'] }}" gateway: "{{ vapp['guestinfo.gateway'] }}" dnsserver: "{{ vapp['guestinfo.dnsserver'] }}" - name: Apply netplan configuration ansible.builtin.shell: cmd: /usr/sbin/netplan apply