User

user

This module allows you to create, update or remove a user.

Example Syntax


name: Create user
ionoscloudsdk.ionoscloud.user:
  firstname: John
  lastname: Doe
  email: ''
  administrator: false
  user_password: '{{ lookup('ansible.builtin.password', '/dev/null chars=ascii_letters,digits') }}'
  force_sec_auth: false
  state: present
check_mode: true
diff: true
register: user_response


name: Add user to first group
ionoscloudsdk.ionoscloud.user:
  user: ''
  groups:
  - 'AnsibleAutoTestUM 1'
  state: update


name: Delete user
ionoscloudsdk.ionoscloud.user:
  user: ''
  state: absent
check_mode: true
diff: true
register: user_response

Returned object

{
    "changed": true,
    "failed": false,
    "action": "create",
    "user": {
        "entities": null,
        "href": "https://api.ionos.com/cloudapi/v6/um/users/<USER_ID>",
        "id": "<USER_ID>",
        "metadata": {
            "created_date": "2023-05-31T13:41:25+00:00",
            "etag": "37a6259cc0c1dae299a7866489dff0bd",
            "last_login": null
        },
        "properties": {
            "active": true,
            "administrator": false,
            "email": "<EMAIL>",
            "firstname": "John2",
            "force_sec_auth": false,
            "lastname": "Doe",
            "s3_canonical_user_id": null,
            "sec_auth_active": false
        },
        "type": "user"
    }
}

For more examples please check out the tests here.

state: present

  
name: Create user
ionoscloudsdk.ionoscloud.user:
  firstname: John
  lastname: Doe
  email: ''
  administrator: false
  user_password: '{{ lookup('ansible.builtin.password', '/dev/null chars=ascii_letters,digits') }}'
  force_sec_auth: false
  state: present
check_mode: true
diff: true
register: user_response

Available parameters for state present:

state: absent

  
name: Delete user
ionoscloudsdk.ionoscloud.user:
  user: ''
  state: absent
check_mode: true
diff: true
register: user_response

Available parameters for state absent:

state: update

  
name: Add user to first group
ionoscloudsdk.ionoscloud.user:
  user: ''
  groups:
  - 'AnsibleAutoTestUM 1'
  state: update

Available parameters for state update:

Last updated