Skip to content

Commit

Permalink
fix: Always import interfaces
Browse files Browse the repository at this point in the history
fixes #296
  • Loading branch information
shinmog committed Jul 27, 2022
1 parent 0619dcb commit 9fa3b6a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugins/modules/panos_aggregate_interface.py
Expand Up @@ -160,12 +160,23 @@

from ansible.module_utils.basic import AnsibleModule
from ansible_collections.paloaltonetworks.panos.plugins.module_utils.panos import (
ConnectionHelper,
get_connection,
)


class Helper(ConnectionHelper):
def initial_handling(self, module):
if module.params['state'] not in ('present', 'replaced'):
return

if module.params['vsys'] is None:
module.params['vsys'] = 'vsys1'


def main():
helper = get_connection(
helper_cls=Helper,
vsys_importable=True,
template=True,
with_classic_provider_spec=True,
Expand Down
6 changes: 6 additions & 0 deletions plugins/modules/panos_l2_subinterface.py
Expand Up @@ -107,6 +107,12 @@ def initial_handling(self, module):
if "." not in module.params["name"]:
module.fail_json(msg='interface name does not have "." in it')

if module.params['state'] not in ('present', 'replaced'):
return

if module.params['vsys'] is None:
module.params['vsys'] = 'vsys1'

def parent_handling(self, parent, module):
iname = module.params["name"].split(".")[0]

Expand Down
6 changes: 6 additions & 0 deletions plugins/modules/panos_l3_subinterface.py
Expand Up @@ -155,6 +155,12 @@ def initial_handling(self, module):
if "." not in module.params["name"]:
module.fail_json(msg='Interface name does not have "." in it')

if module.params['state'] not in ('present', 'replaced'):
return

if module.params['vsys'] is None:
module.params['vsys'] = 'vsys1'

def parent_handling(self, parent, module):
iname = module.params["name"].split(".")[0]

Expand Down
2 changes: 2 additions & 0 deletions plugins/modules/panos_tunnel.py
Expand Up @@ -145,6 +145,8 @@ def initial_handling(self, module):
# TODO(gfreeman) - v2.12, just set the default for vsys to 'vsys1'.
vsys = "vsys1"

module.params['vsys'] = vsys


def main():
helper = get_connection(
Expand Down

0 comments on commit 9fa3b6a

Please sign in to comment.