Note
This module is part of the junipernetworks.junos collection (version 9.1.0).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install junipernetworks.junos. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: junipernetworks.junos.junos_user.
New in junipernetworks.junos 1.0.0
The below requirements are needed on the host that executes this module.
Parameter | Comments |
|---|---|
active boolean | Specifies whether or not the configuration is active or deactivated Choices:
|
aggregate aliases: users, collection list / elements=dictionary | The |
|
active boolean |
Specifies whether or not the configuration is active or deactivated Choices:
|
|
encrypted_password string |
The |
|
full_name string |
The |
|
name string / required |
The |
|
purge boolean |
The Choices:
|
|
role string |
The Choices:
|
|
sshkey string |
The |
|
state string |
The Choices:
|
encrypted_password string | The |
full_name string | The |
name string | The |
purge boolean | The Choices:
|
role string | The Choices:
|
sshkey string | The |
state string | The Choices:
|
Note
netconf. See the Junos OS Platform Options.local connections for legacy playbooks.- name: create new user account
junipernetworks.junos.junos_user:
name: ansible
role: super-user
sshkey: "{{ lookup('file', '~/.ssh/ansible.pub') }}"
state: present
- name: remove a user account
junipernetworks.junos.junos_user:
name: ansible
state: absent
- name: remove all user accounts except ansible
junipernetworks.junos.junos_user:
aggregate:
- name: ansible
purge: true
- name: set user password
junipernetworks.junos.junos_user:
name: ansible
role: super-user
encrypted_password: "{{ 'my-password' | password_hash('sha512') }}"
state: present
- name: Create list of users
junipernetworks.junos.junos_user:
aggregate:
- {name: test_user1, full_name: test_user2, role: operator, state: present}
- {name: test_user2, full_name: test_user2, role: read-only, state: present}
- name: Delete list of users
junipernetworks.junos.junos_user:
aggregate:
- {name: test_user1, full_name: test_user2, role: operator, state: absent}
- {name: test_user2, full_name: test_user2, role: read-only, state: absent}
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
diff.prepared string | Configuration difference before and after applying change. Returned: when configuration is changed and diff option is enabled. Sample: |
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/junipernetworks/junos/junos_user_module.html