- name: "Save Pre Base Configuration"
expect:
command: "ssh {{user}}@{{IP_Address}}"
echo: no
timeout: "{{timer_license}}"
responses:
### ssh known_hosts check
'Are you sure you want to continue connecting.*':
- "yes"
### Initial login password
'Password:':
- "{{ passwd }}"
### Go into configure mode
'\@.*> $':
- "configure private"
- exit
### Commands to run inside configure mode
'\@.*# $':
- save {{Hostname}}_base_configuration
- exit
### Answer yes for any yes/no prompts
'yes\,no.*':
- yes
Hi,
You can use the module which is being written (part of pull request as of now)
https://github.com/Juniper/ansible-junos-stdlib/pull/370
Thanks
Nitin Kr
--
You received this message because you are subscribed to the Google Groups "Junos Python EZ" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
junos-python-...@googlegroups.com.
Visit this group at
https://groups.google.com/group/junos-python-ez.
To view this discussion on the web visit https://groups.google.com/d/msgid/junos-python-ez/a0063962-4840-4221-9562-264dec0d01a5%40googlegroups.com.
I found the solution in the juniper_junos_rpc module.
- name: "Save Pre Base Configuration"
juniper_junos_rpc:
host: "{{hostname}}"
user: "{{user}}"
passwd: "{{ password }}"
port: 22
rpc: 'request-shell-execute'
kwarg:
command: 'cli -c "show configuration | save {{Hostname}}_base_configuration"'