Remove hardcoded ansible user for junos_user integration tests (#56452)

It is possible we are using a different username then 'ansible' for
testing junos. By using ansible_user_id, this should be a more dynamic
check.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2019-05-15 11:09:10 -04:00 committed by Nathaniel Case
parent 63155983fe
commit fa7aedc4c3

View file

@ -172,7 +172,8 @@
- name: Create list of users
junos_user:
aggregate:
- name: ansible
# NOTE(pabelanger): We noop our ansible-test user, as not to lose SSH access
- name: "{{ ansible_user|default('ansible') }}"
- {name: test_user1, full_name: test_user2, role: operator}
- {name: test_user2, full_name: test_user2, role: read-only}
provider: "{{ netconf }}"
@ -181,7 +182,8 @@
- name: Purge users except the users in aggregate
junos_user:
aggregate:
- name: ansible
# NOTE(pabelanger): We noop our ansible-test user, as not to lose SSH access
- name: "{{ ansible_user|default('ansible') }}"
purge: True
provider: "{{ netconf }}"
register: result