mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add net_linkagg platform agnostic module (#26341)
This commit is contained in:
parent
1b427aa419
commit
4869a7b0ac
1 changed files with 91 additions and 0 deletions
91
lib/ansible/modules/network/interface/net_linkagg.py
Normal file
91
lib/ansible/modules/network/interface/net_linkagg.py
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# (c) 2017, Ansible by Red Hat, inc
|
||||||
|
#
|
||||||
|
# This file is part of Ansible by Red Hat
|
||||||
|
#
|
||||||
|
# Ansible is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Ansible is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
ANSIBLE_METADATA = {'metadata_version': '1.0',
|
||||||
|
'status': ['preview'],
|
||||||
|
'supported_by': 'core'}
|
||||||
|
|
||||||
|
|
||||||
|
DOCUMENTATION = """
|
||||||
|
---
|
||||||
|
module: net_linkagg
|
||||||
|
version_added: "2.4"
|
||||||
|
author: "Ricardo Carrillo Cruz (@rcarrillocruz)"
|
||||||
|
short_description: Manage link aggregation groups on network devices
|
||||||
|
description:
|
||||||
|
- This module provides declarative management of link aggregation groups
|
||||||
|
on network devices.
|
||||||
|
options:
|
||||||
|
name:
|
||||||
|
description:
|
||||||
|
- Name of the link aggregation group.
|
||||||
|
required: true
|
||||||
|
mode:
|
||||||
|
description:
|
||||||
|
- Mode of the link aggregation group.
|
||||||
|
default: on
|
||||||
|
choices: ['on', 'active', 'passive']
|
||||||
|
members:
|
||||||
|
description:
|
||||||
|
- List of members of the link aggregation group.
|
||||||
|
required: true
|
||||||
|
min_links:
|
||||||
|
description:
|
||||||
|
- Minimum members that should be up
|
||||||
|
before bringing up the link aggregation group.
|
||||||
|
collection:
|
||||||
|
description: List of link aggregation definitions.
|
||||||
|
purge:
|
||||||
|
description:
|
||||||
|
- Purge link aggregation groups not defined in the collections parameter.
|
||||||
|
default: no
|
||||||
|
state:
|
||||||
|
description:
|
||||||
|
- State of the link aggregation group.
|
||||||
|
default: present
|
||||||
|
choices: ['present', 'absent', 'up', 'down']
|
||||||
|
"""
|
||||||
|
|
||||||
|
EXAMPLES = """
|
||||||
|
- name: configure link aggregation group
|
||||||
|
net_linkagg:
|
||||||
|
name: bond0
|
||||||
|
members:
|
||||||
|
- eth0
|
||||||
|
- eth1
|
||||||
|
|
||||||
|
- name: remove configuration
|
||||||
|
net_linkagg:
|
||||||
|
name: bond0
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
RETURN = """
|
||||||
|
commands:
|
||||||
|
description: The list of configuration mode commands to send to the device
|
||||||
|
returned: always
|
||||||
|
type: list
|
||||||
|
sample:
|
||||||
|
- set interfaces bonding bond0
|
||||||
|
- set interfaces ethernet eth0 bond-group 'bond0'
|
||||||
|
- set interfaces ethernet eth1 bond-group 'bond0'
|
||||||
|
"""
|
Loading…
Reference in a new issue