From b834c87f13e3ec908bfcd79022404ddf71d6559e Mon Sep 17 00:00:00 2001 From: GomathiselviS Date: Mon, 25 Apr 2022 13:55:07 -0400 Subject: Add fqcn to ansible_connection to support stable-2.9 (#254) Add fqcn to ansible_connection to support stable-2.9 Signed-off-by: GomathiselviS gomathiselvi@gmail.com SUMMARY strip_prompt argument is supported only in netcommon network_cli . Vyos jobs on stable-2.9 is failing with the following error, as this argument is not supported ansibe/ansible. This PR sets ansible_connection to ansible.netcommon.network_cli, so that the correct module is used. 2022-04-21 21:14:54.059623 | controller | capabilities = Connection(module._socket_path).get_capabilities() 2022-04-21 21:14:54.059626 | controller | File "/tmp/ansible_vyos.vyos.vyos_config_payload_hjioy2__/ansible_vyos.vyos.vyos_config_payload.zip/ansible/module_utils/connection.py", line 190, in __rpc__ 2022-04-21 21:14:54.059629 | controller | raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code) 2022-04-21 21:14:54.059632 | controller | fatal: [vyos]: FAILED! => { 2022-04-21 21:14:54.059635 | controller | "changed": false, 2022-04-21 21:14:54.059638 | controller | "invocation": { 2022-04-21 21:14:54.059641 | controller | "module_args": { 2022-04-21 21:14:54.059644 | controller | "backup": false, 2022-04-21 21:14:54.059647 | controller | "backup_options": null, 2022-04-21 21:14:54.059650 | controller | "comment": "configured by vyos_config", 2022-04-21 21:14:54.059653 | controller | "config": null, 2022-04-21 21:14:54.059656 | controller | "lines": [ 2022-04-21 21:14:54.059658 | controller | "delete interfaces ethernet eth1", 2022-04-21 21:14:54.059661 | controller | "delete interfaces ethernet eth2" 2022-04-21 21:14:54.059664 | controller | ], 2022-04-21 21:14:54.059667 | controller | "match": "none", 2022-04-21 21:14:54.059670 | controller | "provider": null, 2022-04-21 21:14:54.059673 | controller | "save": false, 2022-04-21 21:14:54.059676 | controller | "src": null 2022-04-21 21:14:54.059678 | controller | } 2022-04-21 21:14:54.059682 | controller | }, 2022-04-21 21:14:54.059685 | controller | "msg": "send() got an unexpected keyword argument 'strip_prompt'" ISSUE TYPE Bugfix Pull Request Docs Pull Request Feature Pull Request New Module Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: Nilashish Chakraborty --- changelogs/fragments/add_fqcn_ansible_connection.yaml | 3 +++ tests/integration/targets/vyos_smoke/tasks/cli.yaml | 4 ++-- tests/integration/targets/vyos_smoke/tests/cli/caching.yaml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/add_fqcn_ansible_connection.yaml diff --git a/changelogs/fragments/add_fqcn_ansible_connection.yaml b/changelogs/fragments/add_fqcn_ansible_connection.yaml new file mode 100644 index 00000000..5b6e80c5 --- /dev/null +++ b/changelogs/fragments/add_fqcn_ansible_connection.yaml @@ -0,0 +1,3 @@ +--- +trivial: + - "change the ansible_connection to ansible.netcommon.network_cli (FQCN)" diff --git a/tests/integration/targets/vyos_smoke/tasks/cli.yaml b/tests/integration/targets/vyos_smoke/tasks/cli.yaml index f5808166..cc5f7df1 100644 --- a/tests/integration/targets/vyos_smoke/tasks/cli.yaml +++ b/tests/integration/targets/vyos_smoke/tasks/cli.yaml @@ -9,8 +9,8 @@ - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" -- name: run test case with single_user_mode (connection=network_cli) - include: '{{ test_case_to_run }} ansible_connection=network_cli ansible_network_single_user_mode=True' +- name: run test case with single_user_mode (connection=ansible.netcommon.network_cli) + include: '{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli ansible_network_single_user_mode=True' with_items: '{{ test_items }}' loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_smoke/tests/cli/caching.yaml b/tests/integration/targets/vyos_smoke/tests/cli/caching.yaml index 4230bfa5..87b93c83 100644 --- a/tests/integration/targets/vyos_smoke/tests/cli/caching.yaml +++ b/tests/integration/targets/vyos_smoke/tests/cli/caching.yaml @@ -82,4 +82,4 @@ always: - name: cleanup vyos.vyos.vyos_config: *rem - when: ansible_connection == "network_cli" and ansible_network_single_user_mode|d(False) + when: ansible_connection == "ansible.netcommon.network_cli" and ansible_network_single_user_mode|d(False) -- cgit v1.2.3