NIC
nic
This module allows you to create, update or remove a NIC.
Example Syntax
name: Create NIC
ionoscloudsdk.ionoscloud.nic:
name: 'AnsibleAutoTestCompute'
datacenter: 'AnsibleAutoTestCompute'
server: 'AnsibleAutoTestCompute'
lan: 2
dhcp: true
firewall_active: true
ips:
- 10.0.0.1
wait: true
wait_timeout: '500'
state: present
register: ionos_cloud_nic
name: Update NIC
ionoscloudsdk.ionoscloud.nic:
datacenter: 'AnsibleAutoTestCompute'
server: 'AnsibleAutoTestCompute'
name: new-nic
nic: ''
dhcp: false
wait: true
wait_timeout: '500'
state: update
register: updated_nic
name: Remove NIC
ionoscloudsdk.ionoscloud.nic:
nic: ''
datacenter: 'AnsibleAutoTestCompute'
server: 'AnsibleAutoTestCompute'
wait: true
wait_timeout: '500'
state: absent
Returned object
{
"changed": true,
"failed": false,
"action": "create",
"nic": {
"entities": {
"firewallrules": {
"links": null,
"href": "https://api.ionos.com/cloudapi/v6/datacenters/f6e15460-e5eb-451a-9da7-08c9da65a179/servers/78ce195d-147b-48d8-a20e-57104b99badd/nics/6e9dd9af-5132-4f8d-a285-62c86956a5da/firewallrules",
"id": "6e9dd9af-5132-4f8d-a285-62c86956a5da/firewallrules",
"items": null,
"limit": null,
"offset": null,
"type": "collection"
},
"flowlogs": {
"links": null,
"href": "https://api.ionos.com/cloudapi/v6/datacenters/f6e15460-e5eb-451a-9da7-08c9da65a179/servers/78ce195d-147b-48d8-a20e-57104b99badd/nics/6e9dd9af-5132-4f8d-a285-62c86956a5da/flowlogs",
"id": "6e9dd9af-5132-4f8d-a285-62c86956a5da/flowlogs",
"items": null,
"limit": null,
"offset": null,
"type": "collection"
}
},
"href": "https://api.ionos.com/cloudapi/v6/datacenters/f6e15460-e5eb-451a-9da7-08c9da65a179/servers/78ce195d-147b-48d8-a20e-57104b99badd/nics/6e9dd9af-5132-4f8d-a285-62c86956a5da",
"id": "6e9dd9af-5132-4f8d-a285-62c86956a5da",
"metadata": {
"created_by": "<USER_EMAIL>",
"created_by_user_id": "<USER_ID>",
"created_date": "2023-05-29T09:27:48+00:00",
"etag": "758f25397e05ac5dace2c18fa851879e",
"last_modified_by": "<USER_EMAIL>",
"last_modified_by_user_id": "<USER_ID>",
"last_modified_date": "2023-05-29T09:27:48+00:00",
"state": "AVAILABLE"
},
"properties": {
"device_number": null,
"dhcp": true,
"firewall_active": true,
"firewall_type": "INGRESS",
"ips": [
"<IP>"
],
"lan": 1,
"mac": "<MAC>",
"name": "AnsibleAutoTestCompute",
"pci_slot": 6
},
"type": "nic"
}
}
For more examples please check out the tests here.
state: present
name: Create NIC
ionoscloudsdk.ionoscloud.nic:
name: 'AnsibleAutoTestCompute'
datacenter: 'AnsibleAutoTestCompute'
server: 'AnsibleAutoTestCompute'
lan: 2
dhcp: true
firewall_active: true
ips:
- 10.0.0.1
wait: true
wait_timeout: '500'
state: present
register: ionos_cloud_nic
Available parameters for state present:
state: absent
name: Remove NIC
ionoscloudsdk.ionoscloud.nic:
nic: ''
datacenter: 'AnsibleAutoTestCompute'
server: 'AnsibleAutoTestCompute'
wait: true
wait_timeout: '500'
state: absent
Available parameters for state absent:
state: update
name: Update NIC
ionoscloudsdk.ionoscloud.nic:
datacenter: 'AnsibleAutoTestCompute'
server: 'AnsibleAutoTestCompute'
name: new-nic
nic: ''
dhcp: false
wait: true
wait_timeout: '500'
state: update
register: updated_nic
Available parameters for state update:
Last updated