Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 387. Added a context firewall raw input, and added parsing for … #388

Closed
wants to merge 3 commits into from
Closed

Fixes 387. Added a context firewall raw input, and added parsing for … #388

wants to merge 3 commits into from

Conversation

jvanderaa
Copy link
Contributor

…the compile date of the code.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT

cisco_asa_show_version

SUMMARY

Added a context firewall command output, as well as a new addition of searching for the software compile date.

Fixes #387

Before

PLAY [Verify TextFSM template] *******************************************************************************************************************************

TASK [cisco_asa_show_version: run TextFSM on test input] *****************************************************************************************************
ok: [localhost] => (item=/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw)
ok: [localhost] => (item=/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw)

TASK [cisco_asa_show_version: read parsed sample files] ******************************************************************************************************
ok: [localhost] => (item={'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'delay': u'1', u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'connection': u'offline', u'use_templates': True, u'platform': u'cisco_asa', u'secret': None, u'command': u'show version', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'hostname': u'asa1', u'interfaces': [u'Management0/0', u'GigabitEthernet0/0', u'GigabitEthernet0/1', u'GigabitEthernet0/2', u'GigabitEthernet0/3', u'GigabitEthernet0/4', u'GigabitEthernet0/5', u'GigabitEthernet0/6'], u'max_intf': u'10', u'hardware': u'ASAv, 2048 MB RAM, CPU Pentium II 1800 MHz', u'cluster': u'Disabled', u'serial': u'9AT1L9EX0DF', u'uptime': u'41 days 19 hours', u'last_mod': u'ntc at 18:56:48.410 UTC Wed Apr 5 2017', u'max_vlans': u'50', u'failover': u'Active/Standby', u'flash': u'8192MB', u'license_mode': u'Smart Licensing', u'version': u'9.5(2)204', u'image': u'boot:/asa952-204-smp-k8.bin', u'model': u'ASAv10', u'device_mgr_version': u'7.5(2)', u'license_state': u'Unlicensed'}], '_ansible_ignore_errors': None, u'response_list': []})
ok: [localhost] => (item={'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'delay': u'1', u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'connection': u'offline', u'use_templates': True, u'platform': u'cisco_asa', u'secret': None, u'command': u'show version', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'hostname': u'fw002', u'interfaces': [], u'max_intf': u'', u'hardware': u'', u'cluster': u'Enabled', u'serial': u'', u'uptime': u'114 days 18 hours', u'last_mod': u'thatperson at 09:15:45.959 EST Mon Dec 12 2018', u'max_vlans': u'', u'failover': u'Active/Active', u'flash': u'', u'license_mode': u'Smart Licensing', u'version': u'9.8(3)21', u'image': u'', u'model': u'', u'device_mgr_version': u'7.8(2)', u'license_state': u''}], '_ansible_ignore_errors': None, u'response_list': []})

TASK [cisco_asa_show_version: verify that parsed result is the same as expected] *****************************************************************************
ok: [localhost] => (item={'_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_asa', u'connection': u'offline', u'command': u'show version', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'flash': u'8192MB', u'image': u'boot:/asa952-204-smp-k8.bin', u'max_intf': u'10', u'hardware': u'ASAv, 2048 MB RAM, CPU Pentium II 1800 MHz', u'cluster': u'Disabled', u'serial': u'9AT1L9EX0DF', u'uptime': u'41 days 19 hours', u'last_mod': u'ntc at 18:56:48.410 UTC Wed Apr 5 2017', u'max_vlans': u'50', u'failover': u'Active/Standby', u'hostname': u'asa1', u'license_mode': u'Smart Licensing', u'version': u'9.5(2)204', u'device_mgr_version': u'7.5(2)', u'model': u'ASAv10', u'interfaces': [u'Management0/0', u'GigabitEthernet0/0', u'GigabitEthernet0/1', u'GigabitEthernet0/2', u'GigabitEthernet0/3', u'GigabitEthernet0/4', u'GigabitEthernet0/5', u'GigabitEthernet0/6'], u'license_state': u'Unlicensed'}], '_ansible_ignore_errors': None, u'response_list': []}, 'ansible_included_var_files': [u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.parsed'], 'ansible_facts': {u'parsed_sample': [{u'flash': u'8192MB', u'image': u'boot:/asa952-204-smp-k8.bin', u'uptime': u'41 days 19 hours', u'hardware': u'ASAv, 2048 MB RAM, CPU Pentium II 1800 MHz', u'cluster': u'Disabled', u'serial': u'9AT1L9EX0DF', u'max_intf': u'10', u'last_mod': u'ntc at 18:56:48.410 UTC Wed Apr 5 2017', u'max_vlans': u'50', u'failover': u'Active/Standby', u'hostname': u'asa1', u'license_mode': u'Smart Licensing', u'version': u'9.5(2)204', u'device_mgr_version': u'7.5(2)', u'model': u'ASAv10', u'interfaces': [u'Management0/0', u'GigabitEthernet0/0', u'GigabitEthernet0/1', u'GigabitEthernet0/2', u'GigabitEthernet0/3', u'GigabitEthernet0/4', u'GigabitEthernet0/5', u'GigabitEthernet0/6'], u'license_state': u'Unlicensed'}]}, '_ansible_ignore_errors': None, '_ansible_item_label': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_asa', u'connection': u'offline', u'command': u'show version', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'flash': u'8192MB', u'image': u'boot:/asa952-204-smp-k8.bin', u'max_intf': u'10', u'hardware': u'ASAv, 2048 MB RAM, CPU Pentium II 1800 MHz', u'cluster': u'Disabled', u'serial': u'9AT1L9EX0DF', u'uptime': u'41 days 19 hours', u'last_mod': u'ntc at 18:56:48.410 UTC Wed Apr 5 2017', u'max_vlans': u'50', u'failover': u'Active/Standby', u'hostname': u'asa1', u'license_mode': u'Smart Licensing', u'version': u'9.5(2)204', u'device_mgr_version': u'7.5(2)', u'model': u'ASAv10', u'interfaces': [u'Management0/0', u'GigabitEthernet0/0', u'GigabitEthernet0/1', u'GigabitEthernet0/2', u'GigabitEthernet0/3', u'GigabitEthernet0/4', u'GigabitEthernet0/5', u'GigabitEthernet0/6'], u'license_state': u'Unlicensed'}], '_ansible_ignore_errors': None, u'response_list': []}})
ok: [localhost] => (item={'_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_asa', u'connection': u'offline', u'command': u'show version', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'flash': u'', u'image': u'', u'max_intf': u'', u'hardware': u'', u'cluster': u'Enabled', u'serial': u'', u'uptime': u'114 days 18 hours', u'last_mod': u'thatperson at 09:15:45.959 EST Mon Dec 12 2018', u'max_vlans': u'', u'failover': u'Active/Active', u'hostname': u'fw002', u'license_mode': u'Smart Licensing', u'version': u'9.8(3)21', u'device_mgr_version': u'7.8(2)', u'model': u'', u'interfaces': [], u'license_state': u''}], '_ansible_ignore_errors': None, u'response_list': []}, 'ansible_included_var_files': [u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.parsed'], 'ansible_facts': {u'parsed_sample': [{u'flash': u'', u'image': u'boot:/asa952-204-smp-k8.bin', u'uptime': u'114 days 18 hours', u'hardware': u'FPR4K-SM-12', u'cluster': u'Enabled', u'serial': u'', u'max_intf': u'', u'last_mod': u'thatperson at 09:15:45.959 EST Mon Dec 12 2018', u'max_vlans': u'', u'failover': u'Active/Active', u'hostname': u'fw002', u'license_mode': u'Smart Licensing', u'version': u'9.8(3)21', u'device_mgr_version': u'7.8(2)', u'model': u'', u'interfaces': [u''], u'license_state': u''}]}, '_ansible_ignore_errors': None, '_ansible_item_label': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_asa', u'connection': u'offline', u'command': u'show version', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'flash': u'', u'image': u'', u'max_intf': u'', u'hardware': u'', u'cluster': u'Enabled', u'serial': u'', u'uptime': u'114 days 18 hours', u'last_mod': u'thatperson at 09:15:45.959 EST Mon Dec 12 2018', u'max_vlans': u'', u'failover': u'Active/Active', u'hostname': u'fw002', u'license_mode': u'Smart Licensing', u'version': u'9.8(3)21', u'device_mgr_version': u'7.8(2)', u'model': u'', u'interfaces': [], u'license_state': u''}], '_ansible_ignore_errors': None, u'response_list': []}})

PLAY RECAP ***************************************************************************************************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=0

After

PLAY [Verify TextFSM template] *******************************************************************************************************************************

TASK [cisco_asa_show_version: run TextFSM on test input] *****************************************************************************************************
ok: [localhost] => (item=/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw)
ok: [localhost] => (item=/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw)

TASK [cisco_asa_show_version: read parsed sample files] ******************************************************************************************************
ok: [localhost] => (item={'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'delay': u'1', u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'connection': u'offline', u'use_templates': True, u'platform': u'cisco_asa', u'secret': None, u'command': u'show version', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'hostname': u'asa1', u'interfaces': [u'Management0/0', u'GigabitEthernet0/0', u'GigabitEthernet0/1', u'GigabitEthernet0/2', u'GigabitEthernet0/3', u'GigabitEthernet0/4', u'GigabitEthernet0/5', u'GigabitEthernet0/6'], u'max_intf': u'10', u'hardware': u'ASAv, 2048 MB RAM, CPU Pentium II 1800 MHz', u'cluster': u'Disabled', u'serial': u'9AT1L9EX0DF', u'uptime': u'41 days 19 hours', u'last_mod': u'ntc at 18:56:48.410 UTC Wed Apr 5 2017', u'max_vlans': u'50', u'failover': u'Active/Standby', u'flash': u'8192MB', u'license_mode': u'Smart Licensing', u'compile_date': u'', u'version': u'9.5(2)204', u'image': u'boot:/asa952-204-smp-k8.bin', u'model': u'ASAv10', u'device_mgr_version': u'7.5(2)', u'license_state': u'Unlicensed'}], '_ansible_ignore_errors': None, u'response_list': []})
ok: [localhost] => (item={'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'delay': u'1', u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'connection': u'offline', u'use_templates': True, u'platform': u'cisco_asa', u'secret': None, u'command': u'show version', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'hostname': u'fw002', u'interfaces': [], u'max_intf': u'', u'hardware': u'', u'cluster': u'Enabled', u'serial': u'', u'uptime': u'114 days 18 hours', u'last_mod': u'thatperson at 09:15:45.959 EST Mon Dec 12 2018', u'max_vlans': u'', u'failover': u'Active/Active', u'flash': u'', u'license_mode': u'Smart Licensing', u'compile_date': u'', u'version': u'9.8(3)21', u'image': u'', u'model': u'', u'device_mgr_version': u'7.8(2)', u'license_state': u''}], '_ansible_ignore_errors': None, u'response_list': []})

TASK [cisco_asa_show_version: verify that parsed result is the same as expected] *****************************************************************************
ok: [localhost] => (item={'_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_asa', u'connection': u'offline', u'command': u'show version', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'flash': u'8192MB', u'image': u'boot:/asa952-204-smp-k8.bin', u'max_intf': u'10', u'hardware': u'ASAv, 2048 MB RAM, CPU Pentium II 1800 MHz', u'cluster': u'Disabled', u'serial': u'9AT1L9EX0DF', u'uptime': u'41 days 19 hours', u'last_mod': u'ntc at 18:56:48.410 UTC Wed Apr 5 2017', u'max_vlans': u'50', u'failover': u'Active/Standby', u'hostname': u'asa1', u'license_mode': u'Smart Licensing', u'compile_date': u'', u'version': u'9.5(2)204', u'device_mgr_version': u'7.5(2)', u'model': u'ASAv10', u'interfaces': [u'Management0/0', u'GigabitEthernet0/0', u'GigabitEthernet0/1', u'GigabitEthernet0/2', u'GigabitEthernet0/3', u'GigabitEthernet0/4', u'GigabitEthernet0/5', u'GigabitEthernet0/6'], u'license_state': u'Unlicensed'}], '_ansible_ignore_errors': None, u'response_list': []}, 'ansible_included_var_files': [u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.parsed'], 'ansible_facts': {u'parsed_sample': [{u'flash': u'8192MB', u'image': u'boot:/asa952-204-smp-k8.bin', u'uptime': u'41 days 19 hours', u'hardware': u'ASAv, 2048 MB RAM, CPU Pentium II 1800 MHz', u'cluster': u'Disabled', u'serial': u'9AT1L9EX0DF', u'max_intf': u'10', u'last_mod': u'ntc at 18:56:48.410 UTC Wed Apr 5 2017', u'max_vlans': u'50', u'failover': u'Active/Standby', u'hostname': u'asa1', u'license_mode': u'Smart Licensing', u'compile_date': u'15-Feb-16', u'version': u'9.5(2)204', u'device_mgr_version': u'7.5(2)', u'model': u'ASAv10', u'interfaces': [u'Management0/0', u'GigabitEthernet0/0', u'GigabitEthernet0/1', u'GigabitEthernet0/2', u'GigabitEthernet0/3', u'GigabitEthernet0/4', u'GigabitEthernet0/5', u'GigabitEthernet0/6'], u'license_state': u'Unlicensed'}]}, '_ansible_ignore_errors': None, '_ansible_item_label': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_asa', u'connection': u'offline', u'command': u'show version', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'flash': u'8192MB', u'image': u'boot:/asa952-204-smp-k8.bin', u'max_intf': u'10', u'hardware': u'ASAv, 2048 MB RAM, CPU Pentium II 1800 MHz', u'cluster': u'Disabled', u'serial': u'9AT1L9EX0DF', u'uptime': u'41 days 19 hours', u'last_mod': u'ntc at 18:56:48.410 UTC Wed Apr 5 2017', u'max_vlans': u'50', u'failover': u'Active/Standby', u'hostname': u'asa1', u'license_mode': u'Smart Licensing', u'compile_date': u'', u'version': u'9.5(2)204', u'device_mgr_version': u'7.5(2)', u'model': u'ASAv10', u'interfaces': [u'Management0/0', u'GigabitEthernet0/0', u'GigabitEthernet0/1', u'GigabitEthernet0/2', u'GigabitEthernet0/3', u'GigabitEthernet0/4', u'GigabitEthernet0/5', u'GigabitEthernet0/6'], u'license_state': u'Unlicensed'}], '_ansible_ignore_errors': None, u'response_list': []}})
ok: [localhost] => (item={'_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_asa', u'connection': u'offline', u'command': u'show version', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'flash': u'', u'image': u'', u'max_intf': u'', u'hardware': u'', u'cluster': u'Enabled', u'serial': u'', u'uptime': u'114 days 18 hours', u'last_mod': u'thatperson at 09:15:45.959 EST Mon Dec 12 2018', u'max_vlans': u'', u'failover': u'Active/Active', u'hostname': u'fw002', u'license_mode': u'Smart Licensing', u'compile_date': u'', u'version': u'9.8(3)21', u'device_mgr_version': u'7.8(2)', u'model': u'', u'interfaces': [], u'license_state': u''}], '_ansible_ignore_errors': None, u'response_list': []}, 'ansible_included_var_files': [u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.parsed'], 'ansible_facts': {u'parsed_sample': [{u'flash': u'', u'image': u'boot:/asa952-204-smp-k8.bin', u'uptime': u'114 days 18 hours', u'hardware': u'FPR4K-SM-12', u'cluster': u'Enabled', u'serial': u'', u'max_intf': u'', u'last_mod': u'thatperson at 09:15:45.959 EST Mon Dec 12 2018', u'max_vlans': u'', u'failover': u'Active/Active', u'hostname': u'fw002', u'license_mode': u'Smart Licensing', u'compile_date': u'07-Aug-18', u'version': u'9.8(3)21', u'device_mgr_version': u'7.8(2)', u'model': u'', u'interfaces': [u''], u'license_state': u''}]}, '_ansible_ignore_errors': None, '_ansible_item_label': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_asa/show_version/cisco_asa_show_version2.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_asa', u'connection': u'offline', u'command': u'show version', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'flash': u'', u'image': u'', u'max_intf': u'', u'hardware': u'', u'cluster': u'Enabled', u'serial': u'', u'uptime': u'114 days 18 hours', u'last_mod': u'thatperson at 09:15:45.959 EST Mon Dec 12 2018', u'max_vlans': u'', u'failover': u'Active/Active', u'hostname': u'fw002', u'license_mode': u'Smart Licensing', u'compile_date': u'', u'version': u'9.8(3)21', u'device_mgr_version': u'7.8(2)', u'model': u'', u'interfaces': [], u'license_state': u''}], '_ansible_ignore_errors': None, u'response_list': []}})

PLAY RECAP ***************************************************************************************************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=0

@jvanderaa
Copy link
Contributor Author

jvanderaa commented Mar 11, 2019

Updates on the last commit include:

  • Modifying the compiled on, was missing the $ in the variable substitution
  • Fixing the parsing of interfaces to being an empty list properly defined
  • Update to the Hardware line, there was a comma in the template that was not allowing for capturing of a string that didn't have a comma in it

@jvanderaa
Copy link
Contributor Author

Previous version of the cisco_asa_show_version.parsed file was missing a comma since it was included in the template. Added this comma that was missing from the parsed file

^System image file.+"${IMAGE}"
^${HOSTNAME} up ${UPTIME}
^Hardware:\s+${HARDWARE},
^Hardware:\s+${HARDWARE}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you keep the hardware line you deleted above the one you changed for hardware? This allows us to capture both instances without adding the extra comma.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checks fail with removing the comma on the raw2 file if I recall properly. I can retest again though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the no comma is needed for the use case found on the raw2 file. Take a peak at the couple of build attempts on #470. @FragmentedPacket

@FragmentedPacket FragmentedPacket added the changes_requested Waiting on user to address feedback label Sep 10, 2019
@FragmentedPacket
Copy link
Contributor

Fixes applied on #470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes_requested Waiting on user to address feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cisco ASA - Missing capture of Software Compile Date
2 participants