a716fe97e3
* Fix nxos_switchport (#37328) (cherry picked from commitff57fd0bb4
) * Fix nxos_l2_interface and test typo (#37336) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commitba5e562c76
) * fix ios_l2_interface (#37389) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commitdd37857884
) * fix required args for nxos_snapshot and docs improvement (#37232) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commita10df8b0b5
) * add nxos_snapshot test for missing required param (#37248) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit2501834c42
) * Ensure network_cli nxos test is run only once - remove unnecessary files (#37462) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit957ab02e52
) * Integration Tests only: nxos_user (#37852) * add new integration file to nxos_user * fix shippable error * change nxapi to connection * review comments (cherry picked from commit63da50e1d8
) * fix UnboundLocalError nxos_bgp_af module (#37610) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit00abe6dbe7
) * Fix nxos_vrf issues (#37092) * fix nxos_vrf issues * fix doc (cherry picked from commitdc61f4c6b1
) * fix nxos_vrf_af issues (#37211) (cherry picked from commit74e79d9f5e
) * fix nxos_udld issues (#37418) (cherry picked from commit05b266cc66
) * fix nxos_vlan issues (#38008) (cherry picked from commit6f2cb28bb9
) * add changelog Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
117 lines
2.4 KiB
YAML
117 lines
2.4 KiB
YAML
---
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_user parameter test"
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
when: ansible_connection == "local"
|
|
|
|
- set_fact: idem="true"
|
|
- set_fact: idem="false"
|
|
when: ((platform is search('N7K')) and (imagetag and (imagetag is version_compare('D1', 'eq'))))
|
|
|
|
- block:
|
|
- name: Create user
|
|
nxos_user: &configure
|
|
name: netend
|
|
configured_password: Hello!23$
|
|
update_password: on_create
|
|
roles: network-operator
|
|
state: present
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: &true
|
|
that:
|
|
- 'result.changed == true'
|
|
|
|
- block:
|
|
- name: conf idempotency
|
|
nxos_user: *configure
|
|
register: result
|
|
|
|
- assert: &false
|
|
that:
|
|
- 'result.changed == false'
|
|
when: idem
|
|
|
|
- name: Remove user
|
|
nxos_user: &remove
|
|
name: netend
|
|
state: absent
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: remove idempotency
|
|
nxos_user: *remove
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- debug: msg="skipping sshkey test as the key needs to be created on the server first"
|
|
|
|
# - name: create a new user
|
|
# nxos_user: &conf1
|
|
# name: ansible
|
|
# sshkey: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
|
|
# state: present
|
|
# provider: "{{ connection }}"
|
|
# register: result
|
|
#
|
|
# - assert: *true
|
|
|
|
# - block:
|
|
# - name: user idempotency
|
|
# nxos_user: *conf1
|
|
# register: result
|
|
#
|
|
# - assert: *false
|
|
#
|
|
# when: idem
|
|
|
|
- name: Collection of users
|
|
nxos_user: &coll
|
|
users:
|
|
- name: test1
|
|
- name: test2
|
|
configured_password: Hello!23$
|
|
update_password: on_create
|
|
state: present
|
|
roles:
|
|
- network-admin
|
|
- network-operator
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- block:
|
|
- name: users idempotency
|
|
nxos_user: *coll
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
when: idem
|
|
|
|
- name: tearDown
|
|
nxos_user: &tear
|
|
name: ansible
|
|
purge: yes
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: teardown idempotency
|
|
nxos_user: *tear
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
always:
|
|
- name: tearDown
|
|
nxos_user: *tear
|
|
register: result
|
|
ignore_errors: yes
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_user parameter test"
|