Skip to content

Commit

Permalink
Cisco ASA & F5 functionality for ntc-ansible: file_copy, install_os, …
Browse files Browse the repository at this point in the history
…reboot operations.
  • Loading branch information
mzbroch committed Sep 19, 2018
1 parent 1f9d61a commit 387dcab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions library/ntc_file_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
description:
- Switch platform
required: false
choices: ['cisco_nxos_nxapi', 'arista_eos_eapi', 'cisco_ios_ssh', 'f5_tmos_icontrol']
choices: ['cisco_nxos_nxapi', 'arista_eos_eapi', 'cisco_ios_ssh', 'cisco_asa_ssh', 'f5_tmos_icontrol']
local_file:
description:
- Path to local file. Local directory must exist.
Expand Down Expand Up @@ -186,13 +186,14 @@
PLATFORM_EAPI = 'arista_eos_eapi'
PLATFORM_JUNOS = 'juniper_junos_netconf'
PLATFORM_F5 = 'f5_tmos_icontrol'
PLATFORM_ASA = 'cisco_asa_ssh'


def main():
module = AnsibleModule(
argument_spec=dict(
platform=dict(choices=[PLATFORM_NXAPI, PLATFORM_IOS, PLATFORM_EAPI,
PLATFORM_JUNOS, PLATFORM_F5],
PLATFORM_JUNOS, PLATFORM_F5, PLATFORM_ASA],
required=False),
host=dict(required=False),
username=dict(required=False, type='str'),
Expand Down
6 changes: 4 additions & 2 deletions library/ntc_install_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- Do not include full file paths, just the name of the file(s) stored on the top level flash directory.
- You must know if your platform supports taking a kickstart image as a parameter. If supplied but not supported, errors may occur.
- It may be useful to use this module in conjuction with ntc_file_copy and ntc_reboot.
- With F5, volume parameter is required.
- With NXOS devices, this module attempts to install the software immediately, wich may trigger a reboot.
- With NXOS devices, install process may take up to 10 minutes, especially if the device reboots.
- Tested on Nexus 3000, 5000, 9000.
Expand All @@ -39,7 +40,7 @@
description:
- Switch platform
required: false
choices: ['cisco_nxos_nxapi', 'arista_eos_eapi', 'cisco_ios_ssh', 'f5_tmos_icontrol']
choices: ['cisco_nxos_nxapi', 'arista_eos_eapi', 'cisco_ios_ssh', 'cisco_asa_ssh', 'f5_tmos_icontrol']
system_image_file:
description:
- Name of the system (or combined) image file on flash.
Expand Down Expand Up @@ -160,6 +161,7 @@
PLATFORM_EAPI = 'arista_eos_eapi'
PLATFORM_JUNOS = 'juniper_junos_netconf'
PLATFORM_F5 = 'f5_tmos_icontrol'
PLATFORM_ASA = 'cisco_asa_ssh'


def already_set(boot_options, system_image_file, kickstart_image_file,
Expand All @@ -178,7 +180,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
platform=dict(choices=[PLATFORM_NXAPI, PLATFORM_IOS, PLATFORM_EAPI,
PLATFORM_JUNOS, PLATFORM_F5],
PLATFORM_JUNOS, PLATFORM_F5, PLATFORM_ASA],
required=False),
host=dict(required=False),
username=dict(required=False, type='str'),
Expand Down
6 changes: 3 additions & 3 deletions library/ntc_reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
description:
- Switch platform
required: false
choices: ['cisco_nxos_nxapi', 'arista_eos_eapi', 'cisco_ios_ssh', 'f5_tmos_icontrol']
choices: ['cisco_nxos_nxapi', 'arista_eos_eapi', 'cisco_ios_ssh', 'cisco_asa_ssh', 'f5_tmos_icontrol']
timer:
description:
- Time in minutes after which the device will be rebooted.
Expand Down Expand Up @@ -181,7 +181,7 @@
PLATFORM_EAPI = 'arista_eos_eapi'
PLATFORM_JUNOS = 'juniper_junos_netconf'
PLATFORM_F5 = 'f5_tmos_icontrol'

PLATFORM_ASA = 'cisco_asa_ssh'

def check_device(module, username, password, host, timeout, kwargs):
success = False
Expand Down Expand Up @@ -214,7 +214,7 @@ def main():
module = AnsibleModule(
argument_spec=dict(
platform=dict(choices=[PLATFORM_NXAPI, PLATFORM_IOS, PLATFORM_EAPI,
PLATFORM_JUNOS, PLATFORM_F5],
PLATFORM_JUNOS, PLATFORM_F5, PLATFORM_ASA],
required=False),
host=dict(required=False),
username=dict(required=False, type='str'),
Expand Down

0 comments on commit 387dcab

Please sign in to comment.