Ansible - save config - Small business SG 500

Ansible version = 2.7.5

Hello all,

I am using Ansible to save configurations of all my switches but they are CISCO small businesses.

I am curently using a playbook like this :

`

Your ‘register’ statement should be less indented

Hello,

thanks for your answer, actually when i do this with “show clock” it works fine.
Taking your advice i tried, this is my ne
`

  • name: IOS | Datadump + Show run
    ios_config:
    authorize: yes
    provider: “{{ provider }}”
    commands:
  • terminal datadump
    register: showrun

`

And it answered back with more errors than before…

`
The full traceback is:
Traceback (most recent call last):
File “/root/.ansible/tmp/ansible-tmp-1548834885.34-267057542623206/AnsiballZ_ios_config.py”, line 113, in
_ansiballz_main()
File “/root/.ansible/tmp/ansible-tmp-1548834885.34-267057542623206/AnsiballZ_ios_config.py”, line 105, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File “/root/.ansible/tmp/ansible-tmp-1548834885.34-267057542623206/AnsiballZ_ios_config.py”, line 48, in invoke_module
imp.load_module(‘main’, mod, module, MOD_DESC)
File “/tmp/ansible_ios_config_payload_5TvH1X/main.py”, line 541, in
File “/tmp/ansible_ios_config_payload_5TvH1X/main.py”, line 472, in main
File “/tmp/ansible_ios_config_payload_5TvH1X/main.py”, line 333, in edit_config_or_macro
File “/tmp/ansible_ios_config_payload_5TvH1X/ansible_ios_config_payload.zip/ansible/module_utils/connection.py”, line 173, in rpc
ansible.module_utils.connection.ConnectionError: operation requires privilege escalation

fatal: [BX-COM-SW6]: FAILED! => {
“changed”: false,
“module_stderr”: “Traceback (most recent call last):\n File "/root/.ansible/tmp/ansible-tmp-1548834885.34-267057542623206/AnsiballZ_ios_config.py", line 113, in \n _ansiballz_main()\n File "/root/.ansible/tmp/ansible-tmp-1548834885.34-267057542623206/AnsiballZ_ios_config.py", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/root/.ansible/tmp/ansible-tmp-1548834885.34-267057542623206/AnsiballZ_ios_config.py", line 48, in invoke_module\n imp.load_module(‘main’, mod, module, MOD_DESC)\n File "/tmp/ansible_ios_config_payload_5TvH1X/main.py", line 541, in \n File "/tmp/ansible_ios_config_payload_5TvH1X/main.py", line 472, in main\n File "/tmp/ansible_ios_config_payload_5TvH1X/main.py", line 333, in edit_config_or_macro\n File "/tmp/ansible_ios_config_payload_5TvH1X/ansible_ios_config_payload.zip/ansible/module_utils/connection.py", line 173, in rpc\nansible.module_utils.connection.ConnectionError: operation requires privilege escalation\n”,
“module_stdout”: “”,
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,
“rc”: 1
}
`

Hello,

You should try, what the documentation recommends:
"Starting with Ansible 2.5 we recommend using "connection: network_cli" and “become: yes" with "become_pass"

From the error, that is clear you have privilege escalation problem:
" ansible.module_utils.connection.ConnectionError: operation requires privilege escalation "

Other deprecated features are used like “provider” and “authorize”.
See here.

Bye,

Krisztian

Jean berjonneau <jin.berjonneau@gmail.com> ezt írta (időpont: 2019. jan. 30., Sze, 8:59):

Hello,

I finally got the answer after weeks of trying:

`