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


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


name: Delete user
ionoscloudsdk.ionoscloud.user:
  user: ''
  state: absent

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

Available parameters for state present:

NameRequiredDescription

firstname str

True

The first name of the user.

lastname str

True

The last name of the user.

email str

True

The email address of the user.

user_password str

True

A password for the user.

administrator bool

False

Indicates if the user has admin rights.

force_sec_auth bool

False

Indicates if secure authentication should be forced on the user.

groups list

False

A list of group IDs or names where the user (non-administrator) is to be added. Set to empty list ([]) to remove the user from all groups.

sec_auth_active bool

False

Indicates if secure authentication is active for the user.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update']

state: absent

  
name: Delete user
ionoscloudsdk.ionoscloud.user:
  user: ''
  state: absent

Available parameters for state absent:

NameRequiredDescription

user str

True

The ID or name of the user.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update']

state: update

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

Available parameters for state update:

NameRequiredDescription

firstname str

False

The first name of the user.

lastname str

False

The last name of the user.

email str

False

The email address of the user.

user str

True

The ID or name of the user.

user_password str

False

A password for the user.

administrator bool

False

Indicates if the user has admin rights.

force_sec_auth bool

False

Indicates if secure authentication should be forced on the user.

groups list

False

A list of group IDs or names where the user (non-administrator) is to be added. Set to empty list ([]) to remove the user from all groups.

sec_auth_active bool

False

Indicates if secure authentication is active for the user.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update']

Last updated