Queries regarding IOS_CONFIG module

Hello

I am aware of parents attribute while defining the configuration. I have queries

  1. how to accomplish below scenario:

archive
log config
logging …
logging size …
path bootflash:zxvf/cfg
maximum 4

  1. It is possible to use same connection for multiple tasks.

Like :

  • name: Configure X
    ios_config:
    lines:
  • version 12.2

provider: “{{ user_credentials }}”

  • name: Configure Y
    ios_config:
    lines:
  • login delay 50

provider: “{{ user_credentials }}”

For above separate SSH connection.

  1. How to make configuration idempotent using

Best Regards,

Harkanwal

Hi Harkanwal,

  1. example below

ios_config:
lines:

  • logging …
  • logging size …
    parents:
  • archive
  • log config
  1. yes, it uses the same connection for multiple tasks by default

  2. the configuration lines in ios_config must match the same as the running config, do not use shortened commands or abbreviations.

Thanks for reply .

Regarding first query.
There are more commands with same level as that of log config

"

path bootflash:zxvf/cfg
maximum 4

"
How to incorporate these .

make another task entry in the playbook

ios_config:
lines:

  • path bootflash:…
  • maximum 4
    parents:
  • archive