02-08-2019 06:00 AM - edited 02-21-2020 08:47 AM
Would anyone be able to provide an example of an ansible yaml file with basic cmds under asa_config module, I have managed to get the asa_command module working. Connection from control node to ASA is via SSH.
I have tried google but found nothing that works yet.
Regards
mk
02-08-2019 06:09 AM - edited 02-08-2019 06:11 AM
Look some example from GIT repository (hope this help you ?)
https://techbloc.net/archives/2360
https://github.com/networklore/ansible-cisco-asa/tree/master/example-playbooks/how-to
02-08-2019 06:47 AM
Thank you Balanji, I have seen that before and I think its a little complex for a beginner.
I will post more details shortly.
Regards
02-08-2019 06:48 AM
I know bit complicate for starter, i can see the pain, But that what it is..
when i get chance over weekend, i had some notes will try to share the one i did last year.
02-08-2019 08:39 AM
This is what I'm testing in GNS3, confirmed SSH access from control node to ASA & can ping via hostname.
Please let me know if you can spot anything.
root@Network Automation-1:~# cat ansible.cfg
[defaults]
hostfile = ./hosts
host_key_checking = false
timeout = 5
root@Network Automation-1:~# cat hosts
[gns3-asa]
ASA
root@Network Automation-1:~# cat asa3.yml
---
- name: testing asa playbook
hosts: ASA
gather_facts: false
connection: local
tasks:
- name: create network object
asa_config:
lines:
- conf t
- network-object host 10.80.30.18
- network-object host 10.80.30.19
parents: ['object-group network SERVERS']
register: print_output
- debug: var=print_output.stdout_lines
All the formatted messed up when I pasted that in, anyway I prompt for userame & password when I run the playbook but it doesn't seem to work.
Regards
mk
02-08-2019 09:06 AM
Hopefully you have access from you Linux to ASA(inside GNS3 ) ? is your linux node inside GNS3 ?
02-08-2019 12:18 PM
linux node has ssh access to asa on mgmt interface..
regards, mk
06-04-2019 08:05 AM
07-07-2021 02:52 PM
Hi,
Do you recall how you handled NAT on the ASA?
Regards,
Jesse Smith
02-12-2019 04:10 AM
Hi Balaji,
Did you manage to find your notes?
Regards, mk
06-01-2019 01:24 AM
Hi All,
I am looking for some help to prepare a script to upgrade cisco ASA.
Thanks in Advance.
Thanks
Sanjay Sehgal
07-30-2019 06:01 AM
Hello everyone,
I am playing around with the asa_module (ansible version 2.8.2) and I have a little problem to list the running configuration.
Everything looks fine when a full admin is logged. However when a read only admin is used, only the part until first page break is listed. Is it possible to send "enter" to the cli within the module, or somehow list full config.
This is how my playbook looks right now:
- name: show run asa_command: commands: show run register: run become: yes tags: - show_run - debug: msg: "{{run.stdout[0]}}" tags: - show_run
Thanks a lot
10-28-2019 06:24 AM
(...an old post to resurrect I know, but I was searching for something and ended up here...)
Instead of trying tab through the show run output, why not remove the terminal pager. Try the following:
- name: show run asa_command: commands: - terminal pager 0 - show run - terminal pager 24 register: run become: yes tags: - show_run
..since we passed three commands, stdout will be a three element list, so you want to view the second element:
- debug: msg: "{{ run.stdout[1] }}" tags: - show_run
cheers,
Seb.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide