IP Block

ipblock

This module allows you to create or remove an IPBlock.

Example Syntax


name: Create ipblock
ionoscloudsdk.ionoscloud.ipblock:
  name: 'AnsibleAutoTestCompute'
  location: 'gb/lhr'
  size: 2
  state: present
register: response


name: Remove ipblock
ionoscloudsdk.ionoscloud.ipblock:
  ipblock: 'AnsibleAutoTestCompute'
  state: absent
register: delete_result

Returned object

{
    "changed": true,
    "failed": false,
    "action": "create",
    "ipblock": {
        "href": "https://api.ionos.com/cloudapi/v6/ipblocks/0bce3fe3-67fd-4d7e-ba86-2e734ad2a79b",
        "id": "0bce3fe3-67fd-4d7e-ba86-2e734ad2a79b",
        "metadata": {
            "created_by": "<USER_EMAIL>",
            "created_by_user_id": "<USER_ID>",
            "created_date": "2023-05-29T11:45:10+00:00",
            "etag": "59558fb22d91e9d6d7a9750aba57fa47",
            "last_modified_by": "<USER_EMAIL>",
            "last_modified_by_user_id": "<USER_ID>",
            "last_modified_date": "2023-05-29T11:45:10+00:00",
            "state": "BUSY"
        },
        "properties": {
            "ip_consumers": [],
            "ips": [
                "<IP1>",
                "<IP2>"
            ],
            "location": "gb/lhr",
            "name": "AnsibleAutoTestCompute",
            "size": 2
        },
        "type": "ipblock"
    }
}

For more examples please check out the tests here.

NOTE: If you are using a versions 7.0.0 and up: modules can replace resources if certain set parameters differ from the results found in the API!

Parameters that can trigger a resource replacement:

  • size

  • location

state: present

  
name: Create ipblock
ionoscloudsdk.ionoscloud.ipblock:
  name: 'AnsibleAutoTestCompute'
  location: 'gb/lhr'
  size: 2
  state: present
register: response

Available parameters for state present:

state: absent

  
name: Remove ipblock
ionoscloudsdk.ionoscloud.ipblock:
  ipblock: 'AnsibleAutoTestCompute'
  state: absent
register: delete_result

Available parameters for state absent:

Last updated