From fa7aedc4c3847dc3f04cbfe8134f03e6d4d7391a Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Wed, 15 May 2019 11:09:10 -0400 Subject: [PATCH] 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 --- .../integration/targets/junos_user/tests/netconf/basic.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/integration/targets/junos_user/tests/netconf/basic.yaml b/test/integration/targets/junos_user/tests/netconf/basic.yaml index 6f730fd06e3..ed80c8710b3 100644 --- a/test/integration/targets/junos_user/tests/netconf/basic.yaml +++ b/test/integration/targets/junos_user/tests/netconf/basic.yaml @@ -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