mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Fixup removed and deprecated modules
* Removed modules no longer have documentation Decided this was causing people to think that modules were supported even after being removed. This change is a new strategy to have the error message trying to use a removed module point people to the older documentation. * Add stubs for modules removed in 2.7 These are freshly removed so we want people who are still using them when they upgrade Ansible to have a hint as to where to find information on how to port. * Finish properly undeprecating include include was undeprecated earlier but not all of the pieces that marked it as deprecated were reverted. This change fixes the remaining pieces
This commit is contained in:
@@ -9,210 +9,12 @@ __metaclass__ = type
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||
'status': ['deprecated'],
|
||||
'status': ['removed'],
|
||||
'supported_by': 'community'}
|
||||
|
||||
|
||||
DOCUMENTATION = r'''
|
||||
---
|
||||
module: cl_bond
|
||||
version_added: "2.1"
|
||||
author: "Cumulus Networks (@CumulusNetworks)"
|
||||
short_description: Configures a bond port on Cumulus Linux
|
||||
deprecated:
|
||||
removed_in: "2.5"
|
||||
why: The M(nclu) module is designed to be easier to use for individuals who are new to Cumulus Linux by exposing the NCLU interface in an automatable way.
|
||||
alternative: Use M(nclu) instead.
|
||||
description:
|
||||
- Configures a bond interface on Cumulus Linux To configure a bridge port
|
||||
use the cl_bridge module. To configure any other type of interface use the
|
||||
cl_interface module. Follow the guidelines for bonding found in the
|
||||
Cumulus User Guide at U(http://docs.cumulusnetworks.com).
|
||||
options:
|
||||
name:
|
||||
description:
|
||||
- Name of the interface.
|
||||
required: true
|
||||
alias_name:
|
||||
description:
|
||||
- Description of the port.
|
||||
ipv4:
|
||||
description:
|
||||
- List of IPv4 addresses to configure on the interface.
|
||||
In the form I(X.X.X.X/YY).
|
||||
ipv6:
|
||||
description:
|
||||
- List of IPv6 addresses to configure on the interface.
|
||||
In the form I(X:X:X::X/YYY).
|
||||
addr_method:
|
||||
description:
|
||||
- Configures the port to use DHCP.
|
||||
To enable this feature use the option I(dhcp).
|
||||
choices: ['dhcp']
|
||||
mtu:
|
||||
description:
|
||||
- Set MTU. Configure Jumbo Frame by setting MTU to I(9000).
|
||||
virtual_ip:
|
||||
description:
|
||||
- Define IPv4 virtual IP used by the Cumulus Linux VRR feature.
|
||||
virtual_mac:
|
||||
description:
|
||||
- Define Ethernet mac associated with Cumulus Linux VRR feature.
|
||||
vids:
|
||||
description:
|
||||
- In vlan-aware mode, lists VLANs defined under the interface.
|
||||
mstpctl_bpduguard:
|
||||
description:
|
||||
- Enables BPDU Guard on a port in vlan-aware mode.
|
||||
choices:
|
||||
- true
|
||||
- false
|
||||
mstpctl_portnetwork:
|
||||
description:
|
||||
- Enables bridge assurance in vlan-aware mode.
|
||||
choices:
|
||||
- true
|
||||
- false
|
||||
mstpctl_portadminedge:
|
||||
description:
|
||||
- Enables admin edge port.
|
||||
choices:
|
||||
- true
|
||||
- false
|
||||
clag_id:
|
||||
description:
|
||||
- Specify a unique clag_id for every dual connected bond on each
|
||||
peer switch. The value must be between 1 and 65535 and must be the
|
||||
same on both peer switches in order for the bond to be considered
|
||||
dual-connected.
|
||||
pvid:
|
||||
description:
|
||||
- In vlan-aware mode, defines vlan that is the untagged vlan.
|
||||
miimon:
|
||||
description:
|
||||
- The mii link monitoring interval.
|
||||
default: 100
|
||||
mode:
|
||||
description:
|
||||
- The bond mode, as of Cumulus Linux 2.5 only LACP bond mode is
|
||||
supported.
|
||||
default: '802.3ad'
|
||||
min_links:
|
||||
description:
|
||||
- Minimum number of links.
|
||||
default: 1
|
||||
lacp_bypass_allow:
|
||||
description:
|
||||
- Enable LACP bypass.
|
||||
lacp_bypass_period:
|
||||
description:
|
||||
- Period for enabling LACP bypass. Max value is 900.
|
||||
lacp_bypass_priority:
|
||||
description:
|
||||
- List of ports and priorities. Example I("swp1=10, swp2=20").
|
||||
lacp_bypass_all_active:
|
||||
description:
|
||||
- Activate all interfaces for bypass.
|
||||
It is recommended to configure all_active instead
|
||||
of using bypass_priority.
|
||||
lacp_rate:
|
||||
description:
|
||||
- The lacp rate.
|
||||
default: 1
|
||||
slaves:
|
||||
description:
|
||||
- Bond members.
|
||||
required: True
|
||||
xmit_hash_policy:
|
||||
description:
|
||||
- Transmit load balancing algorithm. As of Cumulus Linux 2.5 only
|
||||
I(layer3+4) policy is supported.
|
||||
default: layer3+4
|
||||
location:
|
||||
description:
|
||||
- Interface directory location.
|
||||
default:
|
||||
- '/etc/network/interfaces.d'
|
||||
|
||||
requirements: [ Alternate Debian network interface manager - \
|
||||
ifupdown2 @ github.com/CumulusNetworks/ifupdown2 ]
|
||||
notes:
|
||||
- As this module writes the interface directory location, ensure that
|
||||
``/etc/network/interfaces`` has a 'source /etc/network/interfaces.d/\*' or
|
||||
whatever path is mentioned in the ``location`` attribute.
|
||||
|
||||
- For the config to be activated, i.e installed in the kernel,
|
||||
"service networking reload" needs be be executed. See EXAMPLES section.
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
# Options ['virtual_mac', 'virtual_ip'] are required together
|
||||
# configure a bond interface with IP address
|
||||
- cl_bond:
|
||||
name: bond0
|
||||
slaves:
|
||||
- swp4-5
|
||||
ipv4: 10.1.1.1/24
|
||||
|
||||
# configure bond as a dual-connected clag bond
|
||||
- cl_bond:
|
||||
name: bond1
|
||||
slaves:
|
||||
- swp1s0
|
||||
- swp2s0
|
||||
clag_id: 1
|
||||
|
||||
# define cl_bond once in tasks file
|
||||
# then write interface config in variables file
|
||||
# with just the options you want.
|
||||
- cl_bond:
|
||||
name: "{{ item.key }}"
|
||||
slaves: "{{ item.value.slaves }}"
|
||||
clag_id: "{{ item.value.clag_id|default(omit) }}"
|
||||
ipv4: "{{ item.value.ipv4|default(omit) }}"
|
||||
ipv6: "{{ item.value.ipv6|default(omit) }}"
|
||||
alias_name: "{{ item.value.alias_name|default(omit) }}"
|
||||
addr_method: "{{ item.value.addr_method|default(omit) }}"
|
||||
mtu: "{{ item.value.mtu|default(omit) }}"
|
||||
vids: "{{ item.value.vids|default(omit) }}"
|
||||
virtual_ip: "{{ item.value.virtual_ip|default(omit) }}"
|
||||
virtual_mac: "{{ item.value.virtual_mac|default(omit) }}"
|
||||
mstpctl_portnetwork: "{{ item.value.mstpctl_portnetwork|default('no') }}"
|
||||
mstpctl_portadminedge: "{{ item.value.mstpctl_portadminedge|default('no') }}"
|
||||
mstpctl_bpduguard: "{{ item.value.mstpctl_bpduguard|default('no') }}"
|
||||
with_dict: "{{ cl_bonds }}"
|
||||
|
||||
# In vars file
|
||||
# ============
|
||||
---
|
||||
cl_bonds:
|
||||
bond0:
|
||||
alias_name: uplink to isp
|
||||
slaves:
|
||||
- swp1
|
||||
- swp3
|
||||
ipv4: 10.1.1.1/24'
|
||||
bond2:
|
||||
vids:
|
||||
- 1
|
||||
- 50
|
||||
clag_id: 1
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
changed:
|
||||
description: whether the interface was changed
|
||||
returned: changed
|
||||
type: bool
|
||||
sample: True
|
||||
msg:
|
||||
description: human-readable report of success or failure
|
||||
returned: always
|
||||
type: string
|
||||
sample: "interface bond0 config updated"
|
||||
'''
|
||||
|
||||
from ansible.module_utils.common.removed import removed_module
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
removed_module()
|
||||
removed_module(removed_in="2.5")
|
||||
|
||||
@@ -9,158 +9,12 @@ __metaclass__ = type
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||
'status': ['deprecated'],
|
||||
'status': ['removed'],
|
||||
'supported_by': 'community'}
|
||||
|
||||
|
||||
DOCUMENTATION = r'''
|
||||
---
|
||||
module: cl_bridge
|
||||
version_added: "2.1"
|
||||
author: "Cumulus Networks (@CumulusNetworks)"
|
||||
short_description: Configures a bridge port on Cumulus Linux
|
||||
deprecated:
|
||||
removed_in: "2.5"
|
||||
why: The M(nclu) module is designed to be easier to use for individuals who are new to Cumulus Linux by exposing the NCLU interface in an automatable way.
|
||||
alternative: Use M(nclu) instead.
|
||||
description:
|
||||
- Configures a bridge interface on Cumulus Linux To configure a bond port
|
||||
use the cl_bond module. To configure any other type of interface use the
|
||||
cl_interface module. Follow the guidelines for bridging found in the
|
||||
Cumulus User Guide at U(http://docs.cumulusnetworks.com)
|
||||
options:
|
||||
name:
|
||||
description:
|
||||
- Name of the interface.
|
||||
required: true
|
||||
alias_name:
|
||||
description:
|
||||
- Description of the port.
|
||||
ipv4:
|
||||
description:
|
||||
- List of IPv4 addresses to configure on the interface.
|
||||
In the form I(X.X.X.X/YY).
|
||||
ipv6:
|
||||
description:
|
||||
- List of IPv6 addresses to configure on the interface.
|
||||
In the form I(X:X:X::X/YYY).
|
||||
addr_method:
|
||||
description:
|
||||
- Configures the port to use DHCP.
|
||||
To enable this feature use the option I(dhcp).
|
||||
choices: ['dhcp']
|
||||
mtu:
|
||||
description:
|
||||
- Set MTU. Configure Jumbo Frame by setting MTU to I(9000).
|
||||
virtual_ip:
|
||||
description:
|
||||
- Define IPv4 virtual IP used by the Cumulus Linux VRR feature.
|
||||
virtual_mac:
|
||||
description:
|
||||
- Define Ethernet mac associated with Cumulus Linux VRR feature.
|
||||
vids:
|
||||
description:
|
||||
- In vlan-aware mode, lists VLANs defined under the interface.
|
||||
pvid:
|
||||
description:
|
||||
- In vlan-aware mode, defines vlan that is the untagged vlan.
|
||||
stp:
|
||||
description:
|
||||
- Enables spanning tree Protocol. As of Cumulus Linux 2.5 the default
|
||||
bridging mode, only per vlan RSTP or 802.1d is supported. For the
|
||||
vlan aware mode, only common instance STP is supported
|
||||
default: 'yes'
|
||||
choices: ['yes', 'no']
|
||||
ports:
|
||||
description:
|
||||
- List of bridge members.
|
||||
required: True
|
||||
vlan_aware:
|
||||
description:
|
||||
- Enables vlan-aware mode.
|
||||
choices: ['yes', 'no']
|
||||
mstpctl_treeprio:
|
||||
description:
|
||||
- Set spanning tree root priority. Must be a multiple of 4096.
|
||||
location:
|
||||
description:
|
||||
- Interface directory location.
|
||||
default:
|
||||
- '/etc/network/interfaces.d'
|
||||
|
||||
|
||||
requirements: [ Alternate Debian network interface manager
|
||||
ifupdown2 @ github.com/CumulusNetworks/ifupdown2 ]
|
||||
notes:
|
||||
- As this module writes the interface directory location, ensure that
|
||||
``/etc/network/interfaces`` has a 'source /etc/network/interfaces.d/\*' or
|
||||
whatever path is mentioned in the ``location`` attribute.
|
||||
|
||||
- For the config to be activated, i.e installed in the kernel,
|
||||
"service networking reload" needs be be executed. See EXAMPLES section.
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
# Options ['virtual_mac', 'virtual_ip'] are required together
|
||||
# configure a bridge vlan aware bridge.
|
||||
- cl_bridge:
|
||||
name: br0
|
||||
ports: 'swp1-12'
|
||||
vlan_aware: 'yes'
|
||||
notify: reload networking
|
||||
|
||||
# configure bridge interface to define a default set of vlans
|
||||
- cl_bridge:
|
||||
name: bridge
|
||||
ports: 'swp1-12'
|
||||
vlan_aware: 'yes'
|
||||
vids: '1-100'
|
||||
notify: reload networking
|
||||
|
||||
# define cl_bridge once in tasks file
|
||||
# then write interface config in variables file
|
||||
# with just the options you want.
|
||||
- cl_bridge:
|
||||
name: "{{ item.key }}"
|
||||
ports: "{{ item.value.ports }}"
|
||||
vlan_aware: "{{ item.value.vlan_aware|default(omit) }}"
|
||||
ipv4: "{{ item.value.ipv4|default(omit) }}"
|
||||
ipv6: "{{ item.value.ipv6|default(omit) }}"
|
||||
alias_name: "{{ item.value.alias_name|default(omit) }}"
|
||||
addr_method: "{{ item.value.addr_method|default(omit) }}"
|
||||
mtu: "{{ item.value.mtu|default(omit) }}"
|
||||
vids: "{{ item.value.vids|default(omit) }}"
|
||||
virtual_ip: "{{ item.value.virtual_ip|default(omit) }}"
|
||||
virtual_mac: "{{ item.value.virtual_mac|default(omit) }}"
|
||||
mstpctl_treeprio: "{{ item.value.mstpctl_treeprio|default(omit) }}"
|
||||
with_dict: "{{ cl_bridges }}"
|
||||
notify: reload networking
|
||||
|
||||
# In vars file
|
||||
# ============
|
||||
---
|
||||
cl_bridge:
|
||||
br0:
|
||||
alias_name: 'vlan aware bridge'
|
||||
ports: ['swp1', 'swp3']
|
||||
vlan_aware: true
|
||||
vids: ['1-100']
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
changed:
|
||||
description: whether the interface was changed
|
||||
returned: changed
|
||||
type: bool
|
||||
sample: True
|
||||
msg:
|
||||
description: human-readable report of success or failure
|
||||
returned: always
|
||||
type: string
|
||||
sample: "interface bond0 config updated"
|
||||
'''
|
||||
|
||||
from ansible.module_utils.common.removed import removed_module
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
removed_module()
|
||||
removed_module(removed_in="2.5")
|
||||
|
||||
@@ -9,100 +9,12 @@ __metaclass__ = type
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||
'status': ['deprecated'],
|
||||
'status': ['removed'],
|
||||
'supported_by': 'community'}
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: cl_img_install
|
||||
version_added: "2.1"
|
||||
author: "Cumulus Networks (@CumulusNetworks)"
|
||||
short_description: Install a different Cumulus Linux version.
|
||||
deprecated:
|
||||
removed_in: "2.5"
|
||||
why: The image slot system no longer exists in Cumulus Linux.
|
||||
alternative: n/a
|
||||
description:
|
||||
- install a different version of Cumulus Linux in the inactive slot. For
|
||||
more details go the Image Management User Guide at
|
||||
U(http://docs.cumulusnetworks.com/).
|
||||
options:
|
||||
src:
|
||||
description:
|
||||
- The full path to the Cumulus Linux binary image. Can be a local path,
|
||||
http or https URL. If the code version is in the name of the file,
|
||||
the module will assume this is the version of code you wish to
|
||||
install.
|
||||
required: true
|
||||
version:
|
||||
description:
|
||||
- Inform the module of the exact version one is installing. This
|
||||
overrides the automatic check of version in the file name. For
|
||||
example, if the binary file name is called CumulusLinux-2.2.3.bin,
|
||||
and version is set to '2.5.0', then the module will assume it is
|
||||
installing '2.5.0' not '2.2.3'. If version is not included, then
|
||||
the module will assume '2.2.3' is the version to install.
|
||||
switch_slot:
|
||||
description:
|
||||
- Switch slots after installing the image.
|
||||
To run the installed code, reboot the switch.
|
||||
type: bool
|
||||
|
||||
requirements: ["Cumulus Linux OS"]
|
||||
|
||||
'''
|
||||
EXAMPLES = '''
|
||||
## Download and install the image from a webserver.
|
||||
- name: Install image using using http url. Switch slots so the subsequent will load the new version
|
||||
cl_img_install:
|
||||
version: 2.0.1
|
||||
src: http://10.1.1.1/CumulusLinux-2.0.1.bin
|
||||
switch_slot: yes
|
||||
|
||||
## Copy the software from the ansible server to the switch.
|
||||
## The module will get the code version from the filename
|
||||
## The code will be installed in the alternate slot but the slot will not be primary
|
||||
## A subsequent reload will not run the new code
|
||||
|
||||
- name: Download cumulus linux to local system
|
||||
get_url:
|
||||
src: ftp://cumuluslinux.bin
|
||||
dest: /root/CumulusLinux-2.0.1.bin
|
||||
|
||||
- name: Install image from local filesystem. Get version from the filename.
|
||||
cl_img_install:
|
||||
src: /root/CumulusLinux-2.0.1.bin
|
||||
|
||||
## If the image name has been changed from the original name, use the `version` option
|
||||
## to inform the module exactly what code version is been installed
|
||||
|
||||
- name: Download cumulus linux to local system
|
||||
get_url:
|
||||
src: ftp://CumulusLinux-2.0.1.bin
|
||||
dest: /root/image.bin
|
||||
|
||||
- name: install image and switch slots. Only reboot needed
|
||||
cl_img_install:
|
||||
version: 2.0.1
|
||||
src: /root/image.bin
|
||||
switch_slot: yes
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
changed:
|
||||
description: whether the interface was changed
|
||||
returned: changed
|
||||
type: bool
|
||||
sample: True
|
||||
msg:
|
||||
description: human-readable report of success or failure
|
||||
returned: always
|
||||
type: string
|
||||
sample: "interface bond0 config updated"
|
||||
'''
|
||||
|
||||
from ansible.module_utils.common.removed import removed_module
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
removed_module()
|
||||
removed_module(removed_in="2.5")
|
||||
|
||||
@@ -9,203 +9,12 @@ __metaclass__ = type
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||
'status': ['deprecated'],
|
||||
'status': ['removed'],
|
||||
'supported_by': 'community'}
|
||||
|
||||
|
||||
DOCUMENTATION = r'''
|
||||
---
|
||||
module: cl_interface
|
||||
version_added: "2.1"
|
||||
author: "Cumulus Networks (@CumulusNetworks)"
|
||||
short_description: Configures a front panel port, loopback or
|
||||
management port on Cumulus Linux.
|
||||
deprecated:
|
||||
removed_in: "2.5"
|
||||
why: The M(nclu) module is designed to be easier to use for individuals who are new to Cumulus Linux by exposing the NCLU interface in an automatable way.
|
||||
alternative: Use M(nclu) instead.
|
||||
description:
|
||||
- Configures a front panel, sub-interface, SVI, management or loopback port
|
||||
on a Cumulus Linux switch. For bridge ports use the cl_bridge module. For
|
||||
bond ports use the cl_bond module. When configuring bridge related
|
||||
features like the "vid" option, please follow the guidelines for
|
||||
configuring "vlan aware" bridging. For more details review the Layer2
|
||||
Interface Guide at U(http://docs.cumulusnetworks.com)
|
||||
options:
|
||||
name:
|
||||
description:
|
||||
- Name of the interface.
|
||||
required: true
|
||||
alias_name:
|
||||
description:
|
||||
- Description of the port.
|
||||
ipv4:
|
||||
description:
|
||||
- List of IPv4 addresses to configure on the interface.
|
||||
In the form I(X.X.X.X/YY).
|
||||
ipv6:
|
||||
description:
|
||||
- List of IPv6 addresses to configure on the interface.
|
||||
In the form I(X:X:X::X/YYY).
|
||||
addr_method:
|
||||
description:
|
||||
- Address method.
|
||||
choices:
|
||||
- loopback
|
||||
- dhcp
|
||||
speed:
|
||||
description:
|
||||
- Set speed of the swp(front panel) or management(eth0) interface.
|
||||
speed is in MB.
|
||||
mtu:
|
||||
description:
|
||||
- Set MTU. Configure Jumbo Frame by setting MTU to I(9000).
|
||||
virtual_ip:
|
||||
description:
|
||||
- Define IPv4 virtual IP used by the Cumulus Linux VRR feature.
|
||||
virtual_mac:
|
||||
description:
|
||||
- Define Ethernet mac associated with Cumulus Linux VRR feature.
|
||||
vids:
|
||||
description:
|
||||
- In vlan-aware mode, lists VLANs defined under the interface.
|
||||
mstpctl_bpduguard:
|
||||
description:
|
||||
- Enables BPDU Guard on a port in vlan-aware mode.
|
||||
mstpctl_portnetwork:
|
||||
description:
|
||||
- Enables bridge assurance in vlan-aware mode.
|
||||
mstpctl_portadminedge:
|
||||
description:
|
||||
- Enables admin edge port.
|
||||
clagd_enable:
|
||||
description:
|
||||
- Enables the clagd daemon. This command should only be applied to
|
||||
the clag peerlink interface.
|
||||
clagd_priority:
|
||||
description:
|
||||
- Integer that changes the role the switch has in the clag domain.
|
||||
The lower priority switch will assume the primary role. The number
|
||||
can be between 0 and 65535.
|
||||
clagd_peer_ip:
|
||||
description:
|
||||
- IP address of the directly connected peer switch interface.
|
||||
clagd_sys_mac:
|
||||
description:
|
||||
- Clagd system mac address. Recommended to use the range starting
|
||||
with 44:38:39:ff. Needs to be the same between 2 Clag switches.
|
||||
pvid:
|
||||
description:
|
||||
- In vlan-aware mode, defines vlan that is the untagged vlan.
|
||||
location:
|
||||
description:
|
||||
- Interface directory location
|
||||
default:
|
||||
- '/etc/network/interfaces.d'
|
||||
|
||||
requirements: [ Alternate Debian network interface manager - \
|
||||
ifupdown2 @ github.com/CumulusNetworks/ifupdown2 ]
|
||||
notes:
|
||||
- As this module writes the interface directory location, ensure that
|
||||
``/etc/network/interfaces`` has a 'source /etc/network/interfaces.d/\*' or
|
||||
whatever path is mentioned in the ``location`` attribute.
|
||||
|
||||
- For the config to be activated, i.e installed in the kernel,
|
||||
"service networking reload" needs be be executed. See EXAMPLES section.
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
# Options ['virtual_mac', 'virtual_ip'] are required together
|
||||
- name: Configure a front panel port with an IP
|
||||
cl_interface:
|
||||
name: swp1
|
||||
ipv4: 10.1.1.1/24
|
||||
notify: reload networking
|
||||
|
||||
- name: Configure front panel to use DHCP
|
||||
cl_interface:
|
||||
name: swp2
|
||||
addr_family: dhcp
|
||||
notify: reload networking
|
||||
|
||||
- name: Configure a SVI for vlan 100 interface with an IP
|
||||
cl_interface:
|
||||
name: bridge.100
|
||||
ipv4: 10.1.1.1/24
|
||||
notify: reload networking
|
||||
|
||||
- name: Configure subinterface with an IP
|
||||
cl_interface:
|
||||
name: bond0.100
|
||||
alias_name: my bond
|
||||
ipv4: 10.1.1.1/24
|
||||
notify: reload networking
|
||||
|
||||
# define cl_interfaces once in tasks
|
||||
# then write interfaces in variables file
|
||||
# with just the options you want.
|
||||
- name: Create interfaces
|
||||
cl_interface:
|
||||
name: '{{ item.key }}'
|
||||
ipv4: '{{ item.value.ipv4 | default(omit) }}'
|
||||
ipv6: '{{ item.value.ipv6 | default(omit) }}'
|
||||
alias_name: '{{ item.value.alias_name | default(omit) }}'
|
||||
addr_method: '{{ item.value.addr_method | default(omit) }}'
|
||||
speed: '{{ item.value.link_speed | default(omit) }}'
|
||||
mtu: '{{ item.value.mtu | default(omit) }}'
|
||||
clagd_enable: '{{ item.value.clagd_enable | default(omit) }}'
|
||||
clagd_peer_ip: '{{ item.value.clagd_peer_ip | default(omit) }}'
|
||||
clagd_sys_mac: '{{ item.value.clagd_sys_mac | default(omit) }}'
|
||||
clagd_priority: '{{ item.value.clagd_priority | default(omit) }}'
|
||||
vids: '{{ item.value.vids | default(omit) }}'
|
||||
virtual_ip: '{{ item.value.virtual_ip | default(omit) }}'
|
||||
virtual_mac: '{{ item.value.virtual_mac | default(omit) }}'
|
||||
mstpctl_portnetwork: "{{ item.value.mstpctl_portnetwork | default('no') }}"
|
||||
mstpctl_portadminedge: "{{ item.value.mstpctl_portadminedge | default('no') }}"
|
||||
mstpctl_bpduguard: "{{ item.value.mstpctl_bpduguard | default('no') }}"
|
||||
with_dict: '{{ cl_interfaces }}'
|
||||
notify: reload networking
|
||||
|
||||
# In vars file
|
||||
# ============
|
||||
---
|
||||
cl_interfaces:
|
||||
swp1:
|
||||
alias_name: uplink to isp
|
||||
ipv4: 10.1.1.1/24
|
||||
swp2:
|
||||
alias_name: l2 trunk connection
|
||||
vids:
|
||||
- 1
|
||||
- 50
|
||||
swp3:
|
||||
speed: 1000
|
||||
alias_name: connects to 1G link
|
||||
##########
|
||||
# br0 interface is configured by cl_bridge
|
||||
##########
|
||||
br0.100:
|
||||
alias_name: SVI for vlan 100
|
||||
ipv4: 10.2.2.2/24
|
||||
ipv6: '10:2:2::2/127'
|
||||
virtual_ip: 10.2.2.254
|
||||
virtual_mac: 00:00:5E:00:10:10
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
changed:
|
||||
description: whether the interface was changed
|
||||
returned: changed
|
||||
type: bool
|
||||
sample: True
|
||||
msg:
|
||||
description: human-readable report of success or failure
|
||||
returned: always
|
||||
type: string
|
||||
sample: "interface bond0 config updated"
|
||||
'''
|
||||
|
||||
from ansible.module_utils.common.removed import removed_module
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
removed_module()
|
||||
removed_module(removed_in="2.5")
|
||||
|
||||
@@ -9,66 +9,12 @@ __metaclass__ = type
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||
'status': ['deprecated'],
|
||||
'status': ['removed'],
|
||||
'supported_by': 'community'}
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: cl_interface_policy
|
||||
version_added: "2.1"
|
||||
author: "Cumulus Networks (@CumulusNetworks)"
|
||||
short_description: Configure interface enforcement policy on Cumulus Linux
|
||||
deprecated:
|
||||
removed_in: "2.5"
|
||||
why: The M(nclu) module is designed to be easier to use for individuals who are new to Cumulus Linux by exposing the NCLU interface in an automatable way.
|
||||
alternative: Use M(nclu) instead.
|
||||
description:
|
||||
- This module affects the configuration files located in the interfaces
|
||||
folder defined by ifupdown2. Interfaces port and port ranges listed in the
|
||||
"allowed" parameter define what interfaces will be available on the
|
||||
switch. If the user runs this module and has an interface configured on
|
||||
the switch, but not found in the "allowed" list, this interface will be
|
||||
unconfigured. By default this is `/etc/network/interface.d`
|
||||
For more details go the Configuring Interfaces at
|
||||
U(http://docs.cumulusnetworks.com).
|
||||
notes:
|
||||
- lo must be included in the allowed list.
|
||||
- eth0 must be in allowed list if out of band management is done
|
||||
options:
|
||||
allowed:
|
||||
description:
|
||||
- List of ports to run initial run at 10G.
|
||||
required: true
|
||||
location:
|
||||
description:
|
||||
- Directory to store interface files.
|
||||
default: '/etc/network/interfaces.d/'
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
# Example playbook entries using the cl_interface_policy module.
|
||||
|
||||
- name: shows types of interface ranges supported
|
||||
cl_interface_policy:
|
||||
allowed: "lo eth0 swp1-9, swp11, swp12-13s0, swp12-30s1, swp12-30s2, bond0-12"
|
||||
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
changed:
|
||||
description: whether the interface was changed
|
||||
returned: changed
|
||||
type: bool
|
||||
sample: True
|
||||
msg:
|
||||
description: human-readable report of success or failure
|
||||
returned: always
|
||||
type: string
|
||||
sample: "interface bond0 config updated"
|
||||
'''
|
||||
|
||||
from ansible.module_utils.common.removed import removed_module
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
removed_module()
|
||||
removed_module(removed_in="2.5")
|
||||
|
||||
@@ -9,101 +9,12 @@ __metaclass__ = type
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||
'status': ['deprecated'],
|
||||
'status': ['removed'],
|
||||
'supported_by': 'community'}
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: cl_license
|
||||
version_added: "2.1"
|
||||
author: "Cumulus Networks (@CumulusNetworks)"
|
||||
short_description: Install licenses for Cumulus Linux
|
||||
deprecated:
|
||||
why: The M(nclu) module is designed to be easier to use for individuals who are new to Cumulus Linux by exposing the NCLU interface in an automatable way.
|
||||
removed_in: "2.5"
|
||||
alternative: Use M(nclu) instead.
|
||||
description:
|
||||
- Installs a Cumulus Linux license. The module reports no change of status
|
||||
when a license is installed.
|
||||
For more details go the Cumulus Linux License Documentation at
|
||||
U(http://docs.cumulusnetwork.com) and the Licensing KB Site at
|
||||
U(https://support.cumulusnetworks.com/hc/en-us/sections/200507688)
|
||||
notes:
|
||||
- To activate a license for the FIRST time, the switchd service must be
|
||||
restarted. This action is disruptive. The license renewal process occurs
|
||||
via the Cumulus Networks Customer Portal -
|
||||
U(http://customers.cumulusnetworks.com).
|
||||
- A non-EULA license is REQUIRED for automation. Manually install the
|
||||
license on a test switch, using the command "cl-license -i <license_file>"
|
||||
to confirm the license is a Non-EULA license.
|
||||
See EXAMPLES, for the proper way to issue this notify action.
|
||||
options:
|
||||
src:
|
||||
description:
|
||||
- The full path to the license. Can be local path or HTTP URL.
|
||||
required: true
|
||||
force:
|
||||
description:
|
||||
- Force installation of a license. Typically not needed.
|
||||
It is recommended to manually run this command via the ansible
|
||||
command. A reload of switchd is not required. Running the force
|
||||
option in a playbook will break the idempotent state machine of
|
||||
the module and cause the switchd notification to kick in all the
|
||||
time, causing a disruption.
|
||||
choices:
|
||||
- yes
|
||||
- no
|
||||
|
||||
'''
|
||||
EXAMPLES = '''
|
||||
# Example playbook using the cl_license module to manage licenses on Cumulus Linux
|
||||
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: install license using http url
|
||||
cl_license:
|
||||
src: http://10.1.1.1/license.txt
|
||||
notify: restart switchd
|
||||
|
||||
- name: Triggers switchd to be restarted right away, before play, or role
|
||||
is over. This is desired behaviour
|
||||
meta: flush_handlers
|
||||
|
||||
- name: Configure interfaces
|
||||
template:
|
||||
src: interfaces.j2
|
||||
dest: /etc/network/interfaces
|
||||
notify: restart networking
|
||||
|
||||
handlers:
|
||||
- name: restart switchd
|
||||
service:
|
||||
name: switchd
|
||||
state: restarted
|
||||
- name: restart networking
|
||||
service:
|
||||
name: networking
|
||||
state: reloaded
|
||||
|
||||
# Force all switches to accept a new license. Typically not needed
|
||||
# ansible -m cl_license -a "src='http://10.1.1.1/new_lic' force=yes" -u root all
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
changed:
|
||||
description: whether the interface was changed
|
||||
returned: changed
|
||||
type: bool
|
||||
sample: True
|
||||
msg:
|
||||
description: human-readable report of success or failure
|
||||
returned: always
|
||||
type: string
|
||||
sample: "interface bond0 config updated"
|
||||
'''
|
||||
|
||||
from ansible.module_utils.common.removed import removed_module
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
removed_module()
|
||||
removed_module(removed_in="2.5")
|
||||
|
||||
@@ -9,79 +9,12 @@ __metaclass__ = type
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||
'status': ['deprecated'],
|
||||
'status': ['removed'],
|
||||
'supported_by': 'community'}
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: cl_ports
|
||||
version_added: "2.1"
|
||||
author: "Cumulus Networks (@CumulusNetworks)"
|
||||
short_description: Configure Cumulus Switch port attributes (ports.conf)
|
||||
deprecated:
|
||||
removed_in: "2.5"
|
||||
why: The M(nclu) module is designed to be easier to use for individuals who are new to Cumulus Linux by exposing the NCLU interface in an automatable way.
|
||||
alternative: Use M(nclu) instead.
|
||||
description:
|
||||
- Set the initial port attribute defined in the Cumulus Linux ports.conf,
|
||||
file. This module does not do any error checking at the moment. Be careful
|
||||
to not include ports that do not exist on the switch. Carefully read the
|
||||
original ports.conf file for any exceptions or limitations.
|
||||
For more details go the Configure Switch Port Attribute Documentation at
|
||||
U(http://docs.cumulusnetworks.com).
|
||||
options:
|
||||
speed_10g:
|
||||
description:
|
||||
- List of ports to run initial run at 10G.
|
||||
speed_40g:
|
||||
description:
|
||||
- List of ports to run initial run at 40G.
|
||||
speed_4_by_10g:
|
||||
description:
|
||||
- List of 40G ports that will be unganged to run as 4 10G ports.
|
||||
speed_40g_div_4:
|
||||
description:
|
||||
- List of 10G ports that will be ganged to form a 40G port.
|
||||
'''
|
||||
EXAMPLES = '''
|
||||
# Use cl_ports module to manage the switch attributes defined in the
|
||||
# ports.conf file on Cumulus Linux
|
||||
|
||||
## Unganged port configuration on certain ports
|
||||
- name: configure ports.conf setup
|
||||
cl_ports:
|
||||
speed_4_by_10g:
|
||||
- swp1
|
||||
- swp32
|
||||
speed_40g:
|
||||
- swp2-31
|
||||
|
||||
## Unganged port configuration on certain ports
|
||||
- name: configure ports.conf setup
|
||||
cl_ports:
|
||||
speed_4_by_10g:
|
||||
- swp1-3
|
||||
- swp6
|
||||
speed_40g:
|
||||
- swp4-5
|
||||
- swp7-32
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
changed:
|
||||
description: whether the interface was changed
|
||||
returned: changed
|
||||
type: bool
|
||||
sample: True
|
||||
msg:
|
||||
description: human-readable report of success or failure
|
||||
returned: always
|
||||
type: string
|
||||
sample: "interface bond0 config updated"
|
||||
'''
|
||||
|
||||
from ansible.module_utils.common.removed import removed_module
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
removed_module()
|
||||
removed_module(removed_in="2.5")
|
||||
|
||||
@@ -17,108 +17,12 @@
|
||||
#
|
||||
|
||||
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||
'status': ['deprecated'],
|
||||
'status': ['removed'],
|
||||
'supported_by': 'network'}
|
||||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: nxos_mtu
|
||||
extends_documentation_fragment: nxos
|
||||
version_added: "2.2"
|
||||
deprecated:
|
||||
removed_in: "2.5"
|
||||
why: Replaced with common C(*_system) network modules.
|
||||
alternative: Use M(nxos_system)'s C(system_mtu) option. To specify an interfaces MTU use M(nxos_interface).
|
||||
short_description: Manages MTU settings on Nexus switch.
|
||||
description:
|
||||
- Manages MTU settings on Nexus switch.
|
||||
author:
|
||||
- Jason Edelman (@jedelman8)
|
||||
notes:
|
||||
- Tested against NXOSv 7.3.(0)D1(1) on VIRL
|
||||
- Either C(sysmtu) param is required or (C(interface) AND C(mtu)) parameters are required.
|
||||
- C(state=absent) unconfigures a given MTU if that value is currently present.
|
||||
options:
|
||||
interface:
|
||||
description:
|
||||
- Full name of interface, i.e. Ethernet1/1.
|
||||
mtu:
|
||||
description:
|
||||
- MTU for a specific interface. Must be an even number between 576 and 9216.
|
||||
sysmtu:
|
||||
description:
|
||||
- System jumbo MTU. Must be an even number between 576 and 9216.
|
||||
state:
|
||||
description:
|
||||
- Specify desired state of the resource.
|
||||
default: present
|
||||
choices: ['present','absent']
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
# Ensure system mtu is 9126
|
||||
- nxos_mtu:
|
||||
sysmtu: 9216
|
||||
host: "{{ inventory_hostname }}"
|
||||
username: "{{ un }}"
|
||||
password: "{{ pwd }}"
|
||||
|
||||
# Config mtu on Eth1/1 (routed interface)
|
||||
- nxos_mtu:
|
||||
interface: Ethernet1/1
|
||||
mtu: 1600
|
||||
host: "{{ inventory_hostname }}"
|
||||
username: "{{ un }}"
|
||||
password: "{{ pwd }}"
|
||||
|
||||
# Config mtu on Eth1/3 (switched interface)
|
||||
- nxos_mtu:
|
||||
interface: Ethernet1/3
|
||||
mtu: 9216
|
||||
host: "{{ inventory_hostname }}"
|
||||
username: "{{ un }}"
|
||||
password: "{{ pwd }}"
|
||||
|
||||
# Unconfigure mtu on a given interface
|
||||
- nxos_mtu:
|
||||
interface: Ethernet1/3
|
||||
mtu: 9216
|
||||
host: "{{ inventory_hostname }}"
|
||||
username: "{{ un }}"
|
||||
password: "{{ pwd }}"
|
||||
state: absent
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
proposed:
|
||||
description: k/v pairs of parameters passed into module
|
||||
returned: always
|
||||
type: dict
|
||||
sample: {"mtu": "1700"}
|
||||
existing:
|
||||
description:
|
||||
- k/v pairs of existing mtu/sysmtu on the interface/system
|
||||
returned: always
|
||||
type: dict
|
||||
sample: {"mtu": "1600", "sysmtu": "9216"}
|
||||
end_state:
|
||||
description: k/v pairs of mtu/sysmtu values after module execution
|
||||
returned: always
|
||||
type: dict
|
||||
sample: {"mtu": "1700", sysmtu": "9216"}
|
||||
updates:
|
||||
description: command sent to the device
|
||||
returned: always
|
||||
type: list
|
||||
sample: ["interface vlan10", "mtu 1700"]
|
||||
changed:
|
||||
description: check to see if a change was made on the device
|
||||
returned: always
|
||||
type: boolean
|
||||
sample: true
|
||||
'''
|
||||
|
||||
from ansible.module_utils.common.removed import removed_module
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
removed_module()
|
||||
removed_module(removed_in="2.5")
|
||||
|
||||
Reference in New Issue
Block a user