diff options
author | Mike Wiebe <mwiebe@cisco.com> | 2019-09-11 10:10:14 -0400 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2019-09-16 15:44:10 -0700 |
commit | 54f23c7ef7f55e185e6b6e4fdafc3d988e083559 (patch) | |
tree | 9df035ef4052eba56b5f053e5683ff7fb3b30ae9 /test/integration/targets/nxos_smoke | |
parent | 773755de6b4b867d71ff1a1dc495e7399f65cc13 (diff) | |
download | ansible-54f23c7ef7f55e185e6b6e4fdafc3d988e083559.tar.gz |
Add proper hostname cleanup for nxos tests (#61810)
(cherry picked from commit c5a4086ed73cff81423e99f0536f04779b0a5c92)
Diffstat (limited to 'test/integration/targets/nxos_smoke')
-rw-r--r-- | test/integration/targets/nxos_smoke/tasks/main.yaml | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/integration/targets/nxos_smoke/tasks/main.yaml b/test/integration/targets/nxos_smoke/tasks/main.yaml index 4b0f8c64d9..b165a5f6e1 100644 --- a/test/integration/targets/nxos_smoke/tasks/main.yaml +++ b/test/integration/targets/nxos_smoke/tasks/main.yaml @@ -1,3 +1,14 @@ --- -- { include: cli.yaml, tags: ['cli'] } -- { include: nxapi.yaml, tags: ['nxapi'] } +# Some of the tests in this suite change the hostname to switch. +# This block/always ensures the hostname gets changed back to +# the correct name. +- block: + - { include: cli.yaml, tags: ['cli'] } + - { include: nxapi.yaml, tags: ['nxapi'] } + + always: + - name: "Change hostname back to {{ inventory_hostname_short }}" + nxos_config: + lines: + - "hostname {{ inventory_hostname_short }}" + match: none |