Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions plugins/modules/panos_logical_router.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

# Copyright 2018 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import, division, print_function

__metaclass__ = type

DOCUMENTATION = """
---
module: panos_logical_router
short_description: Manage a Virtual Router
description:
- Manage PANOS Logical Routers. Note that for the use of logical routers on PAN-OS NGFW devices, you must enable
"advanced routing" under device->setup->management->General Settings.
author:
- Joshua Colson (@freakinhippie)
- Garfield Lee Freeman (@shinmog)
version_added: '1.0.0'
requirements:
- pan-python can be obtained from PyPI U(https://pypi.python.org/pypi/pan-python)
- pandevice can be obtained from PyPI U(https://pypi.python.org/pypi/pandevice)
extends_documentation_fragment:
- paloaltonetworks.panos.fragments.transitional_provider
- paloaltonetworks.panos.fragments.network_resource_module_state
- paloaltonetworks.panos.fragments.gathered_filter
- paloaltonetworks.panos.fragments.full_template_support
- paloaltonetworks.panos.fragments.deprecated_commit
notes:
- Checkmode is supported.
- Panorama is supported.
options:
name:
description:
- Name of virtual router
type: str
"""

EXAMPLES = """
- name: Create Logical Router
paloaltonetworks.panos.panos_logical_router:
provider: '{{ provider }}'
name: lr-1
commit: true
"""

RETURN = """
# Default return values
"""

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


def main():
helper = get_connection(
template=True,
template_stack=True,
with_network_resource_module_state=True,
with_gathered_filter=True,
with_classic_provider_spec=True,
with_commit=True,
sdk_cls=("network", "LogicalRouter"),
sdk_params=dict(name=dict(required=True)),
)

module = AnsibleModule(
argument_spec=helper.argument_spec,
supports_check_mode=True,
required_one_of=helper.required_one_of,
)

helper.process(module)


if __name__ == "__main__":
main()
Loading