|
|
@ -83,6 +83,14 @@ options:
|
|
|
|
`admin` user and the current defined set of users.
|
|
|
|
`admin` user and the current defined set of users.
|
|
|
|
type: bool
|
|
|
|
type: bool
|
|
|
|
default: false
|
|
|
|
default: false
|
|
|
|
|
|
|
|
admin:
|
|
|
|
|
|
|
|
description:
|
|
|
|
|
|
|
|
- Enters into administration configuration mode for making config
|
|
|
|
|
|
|
|
changes to the device.
|
|
|
|
|
|
|
|
- Applicable only when using network_cli transport
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
|
|
|
|
default: false
|
|
|
|
|
|
|
|
version_added: "2.8"
|
|
|
|
state:
|
|
|
|
state:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Configures the state of the username definition
|
|
|
|
- Configures the state of the username definition
|
|
|
@ -123,6 +131,12 @@ EXAMPLES = """
|
|
|
|
name: ansible
|
|
|
|
name: ansible
|
|
|
|
configured_password: mypassword
|
|
|
|
configured_password: mypassword
|
|
|
|
state: present
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: create a new user in admin configuration mode
|
|
|
|
|
|
|
|
iosxr_user:
|
|
|
|
|
|
|
|
name: ansible
|
|
|
|
|
|
|
|
configured_password: mypassword
|
|
|
|
|
|
|
|
admin: True
|
|
|
|
|
|
|
|
state: present
|
|
|
|
- name: remove all users except admin
|
|
|
|
- name: remove all users except admin
|
|
|
|
iosxr_user:
|
|
|
|
iosxr_user:
|
|
|
|
purge: True
|
|
|
|
purge: True
|
|
|
@ -478,7 +492,8 @@ class CliConfiguration(ConfigBase):
|
|
|
|
self._result['commands'] = []
|
|
|
|
self._result['commands'] = []
|
|
|
|
if commands:
|
|
|
|
if commands:
|
|
|
|
commit = not self._module.check_mode
|
|
|
|
commit = not self._module.check_mode
|
|
|
|
diff = load_config(self._module, commands, commit=commit)
|
|
|
|
admin = self._module.params['admin']
|
|
|
|
|
|
|
|
diff = load_config(self._module, commands, commit=commit, admin=admin)
|
|
|
|
if diff:
|
|
|
|
if diff:
|
|
|
|
self._result['diff'] = dict(prepared=diff)
|
|
|
|
self._result['diff'] = dict(prepared=diff)
|
|
|
|
|
|
|
|
|
|
|
@ -638,6 +653,8 @@ def main():
|
|
|
|
configured_password=dict(no_log=True),
|
|
|
|
configured_password=dict(no_log=True),
|
|
|
|
update_password=dict(default='always', choices=['on_create', 'always']),
|
|
|
|
update_password=dict(default='always', choices=['on_create', 'always']),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin=dict(type='bool', default=False),
|
|
|
|
|
|
|
|
|
|
|
|
public_key=dict(),
|
|
|
|
public_key=dict(),
|
|
|
|
public_key_contents=dict(),
|
|
|
|
public_key_contents=dict(),
|
|
|
|
|
|
|
|
|
|
|
|