- name: Create Linode Instance hosts: localhost gather_facts: false tasks: - name: Create a Linode virtual private cloud (VPC) linode.cloud.vpc: api_token: "{{ api_token }}" label: "{{ vpc_name }}" region: "{{ region }}" state: present #tags: "{{ server_tags }}" register: _vpc_creation - name: Create a VPC Subnet linode.cloud.vpc_subnet: api_token: "{{ api_token }}" vpc_id: "{{ _vpc_creation.vpc.id }}" label: "{{ subnet_name }}" ipv4: "{{ subnet_ipv4 }}" state: present register: _subnet_creation - name: Create a Linode instance linode.cloud.instance: api_token: "{{ api_token }}" label: "{{ server_name }}" type: "{{ instance_type }}" region: "{{ region }}" image: linode/ubuntu22.04 root_pass: "{{ password }}" authorized_keys: - "{{ copy_local_key }}" interfaces: - purpose: public - purpose: vpc subnet_id: "{{ _subnet_creation.subnet.id }}" state: present #tags: "{{ server_tags }}" register: _linode_creation - set_fact: server_status: "{{ _linode_creation.instance.status }}" cloud_instance_ip: "{{ _linode_creation.instance.ipv4[0] }}"