---
title: "Admin User"
canonical: "https://docs.infoblox.com/space/niosmodulesansible/1161920521/Admin%20User"
format: markdown
---
Use the `nios_adminuser` module to create, update, or remove an admin user object from a NIOS Grid.

The following table describes the parameters you can define in the `nios_adminuser` module:

| **Parameter** | **Required/Optional** | **Description** |
| --- | --- | --- |
| `name` | Required | Specifies the name of the admin user that you want to add, update, or remove from NIOS. |
| `admin_groups` | Required | Specifies the names of admin groups to which this user belongs.  
Note that in the current release, you can specify one group only. |
| `password` | Optional | Specifies the password to use when signing in as this user.  
To define this parameter, you must set `auth_type` to `LOCAL` or `SAML_LOCAL`.<br>Note: If a playbook has the `password` parameter defined, then the value of the `password` parameter is updated every time the playbook is run. |
| `auth_type` | Optional | Specifies the authentication type for the admin user.  
You can configure any of the following authentication types:<br>- `LOCAL`
- `REMOTE`
- `SAML`
- `SAML_LOCAL`<br>The default type is `LOCAL`. |
| `auth_method` | Optional | Specifies the authentication method that must be used to authenticate this user.  
You can configure one of the following methods:<br>- `KEYPAIR`
- `KEYPAIR_PASSWORD`<br>The default value is `KEYPAIR`.<br>To define this parameter, you must set `auth_type` to `LOCAL` or `SAML_LOCAL`. |
| `enable_certificate_authentication` | Optional | Determines whether the user is allowed to sign in only with the CA certificate.   
When you enable this parameter by setting it to `true`, the username/password authentication will be disabled for this user. The default value is `false`.<br>Note: To use certificate authentication, you must set the `auth_type` parameter to `LOCAL`. |
| `ca_certificate_issuer` | Optional | Specifies the CA certificate that is used for user lookup when authenticating this user.  
This is a required field when you set `enable_certificate_authentication` to `true`. |
| `client_certificate_serial_number` | Optional | Specifies the serial number of the client certificate.  
This is a required field when you set `enable_certificate_authentication` to `true`. |
| `disable` | Optional | Determines whether the admin user is disabled or not. When this is set to `False`, the admin user is enabled. |
| `email` | Optional | Specifies the email address of the admin user. |
| `use_time_zone` | Optional | Determines whether a time zone must be used for this user.  
When this parameter is set to `true`, you can define a time zone for the admin user. The default value is `false`. |
| `time_zone` | Optional | Specifies the time zone for this admin user.  
This parameter is enabled when you set `use_time_zone` to `true`. The default zone is `UTC`.<br>For valid values, refer to the adminuser object in the WAPI documentation. |
| `use_ssh_keys` | Optional | Determines whether SSH keys must be used to authenticate this user.  
When it is set to `true`, the use of SSH keys is enabled. The default value is `false`.<br>Note: To use SSH keys for authentication, you must set the `auth_type` parameter to `LOCAL`or `SAML_LOCAL`. |
| `ssh_keys` | Optional | Specifies the list of SSH keys for the admin user.<br>- `key_name`
- `key_type`: The valid values you can configure are:
  - `ECDSA`
  - `ED25519`
  - `RSA`
- `key_value`<br>This is a required field when you set `use_ssh_keys` to `true`. |
| `extattrs` | Optional | Specifies extensible attributes for the admin user object. |
| `state` | Optional | Specifies the state of the admin user instance on the NIOS server.  
Set one of the following values:<br>- `present` (default): Configures the record.
- `absent`: Removes the record. |
| `comment` | Optional | Describes the admin user object. |
| `provider` | Required | Defines the details of the connection:<br>- `host`: The DNS host name or IP address to connect to the remote instance of NIOS.
- `username`: The user name to use for authenticating the connection to the remote instance.
- `password`: The password to use for authenticating the connection to the remote instance.<br>For information on additional fields you can define, see the list of subparameters in the *[NIOS Modules for Ansible Collections](https://infoblox-docs.atlassian.net/wiki/spaces/niosmodulesansible/pages/44525470)* topic. |
| `connection` | Required | The `nios_adminuser` module must be run locally. |

## Examples

`name: Create a new admin user`  
`infoblox.nios_modules.nios_adminuser:`  
`  name: ansible_user`  
`  admin_groups: admin-group`  
`  password: "secure_password"`  
`  state: present`  
`  provider:`  
`    host: "{{ inventory_hostname_short }}"`  
`    username: admin`  
`    password: admin`  
`connection: local`


`name: Update admin user name`  
`infoblox.nios_modules.nios_adminuser:`  
`  name: {new_name: new_user, old_name: ansible_user}`  
`  admin_groups: admin-group`  
`  state: present`  
`  provider:`  
`    host: "{{ inventory_hostname_short }}"`  
`    username: admin`  
`    password: admin`  
`connection: local`


`name: Create admin user with remote authentication`  
`infoblox.nios_modules.nios_adminuser:`  
`  name: remote_admin_user`  
`  admin_groups: admin-group`  
`  auth_type: "REMOTE"`  
`  email: "admin@example.com"`  
`  use_time_zone: true`  
`  time_zone: 'US/Hawaii'`  
`  extattrs:`  
`    Site: "USA"`  
`  state: present`  
`  provider:`  
`    host: "{{ inventory_hostname_short }}"`  
`    username: admin`  
`    password: admin`  
`connection: local`


`name: Create admin user with ssh keys`  
`infoblox.nios_modules.nios_adminuser:`  
`  name: cloud_user`  
`  admin_groups: cloud-api-only`  
`  comment: "Created by Ansible"`  
`  disable : false`  
`  password: "secure_password"`  
`  use_ssh_keys: true`  
`  ssh_keys:`  
`    - key_name: "sshkey1"`  
`      key_type: "RSA"`  
`      key_value: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"`  
`    - key_name: "sshkey2"`  
`      key_type: "ECDSA"`  
`      key_value: "{{ lookup('file', '~/.ssh/id_ecdsa.pub') }}"`  
`  state: present`  
`  provider:`  
`    host: "{{ inventory_hostname_short }}"`  
`    username: admin`  
`    password: admin`  
`connection: local`


`name: Update admin user to enable certificate authentication`  
`infoblox.nios_modules.nios_adminuser:`  
`  name: admin_user`  
`  admin_groups: admin-group`  
`  enable_certificate_authentication: true`  
`  ca_certificate_issuer: 'CN="ib-root-ca"'`  
`  client_certificate_serial_number: "397F9435000100000031"`  
`  state: present`  
`  provider:`  
`    host: "{{ inventory_hostname_short }}"`  
`    username: admin`  
`    password: admin`  
`connection: local`


`name: Remove admin user`  
`infoblox.nios_modules.nios_adminuser:`  
`  name: new_user`  
`  admin_groups: admin-group`  
`  state: absent`  
`  provider:`  
`    host: "{{ inventory_hostname_short }}"`  
`    username: admin`  
`    password: admin`  
`connection: local`