mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Inline attays (#19061)
This commit is contained in:
parent
e5bc2e0570
commit
013722d974
4 changed files with 69 additions and 67 deletions
|
@ -152,16 +152,17 @@ EXAMPLES = '''
|
|||
# configure a bond interface with IP address
|
||||
- cl_bond:
|
||||
name: bond0
|
||||
slaves: "swp4-5"
|
||||
slaves:
|
||||
- swp4-5
|
||||
ipv4: 10.1.1.1/24
|
||||
notify: reload networking
|
||||
|
||||
# configure bond as a dual-connected clag bond
|
||||
- cl_bond:
|
||||
name: bond1
|
||||
slaves: "swp1s0 swp2s0"
|
||||
slaves:
|
||||
- swp1s0
|
||||
- swp2s0
|
||||
clag_id: 1
|
||||
notify: reload networking
|
||||
|
||||
# define cl_bond once in tasks file
|
||||
# then write interface config in variables file
|
||||
|
@ -182,17 +183,20 @@ EXAMPLES = '''
|
|||
mstpctl_portadminedge: "{{ item.value.mstpctl_portadminedge|default('no') }}"
|
||||
mstpctl_bpduguard: "{{ item.value.mstpctl_bpduguard|default('no') }}"
|
||||
with_dict: "{{ cl_bonds }}"
|
||||
notify: reload networking
|
||||
|
||||
# In vars file
|
||||
# ============
|
||||
cl_bonds:
|
||||
bond0:
|
||||
alias_name: 'uplink to isp'
|
||||
slaves: ['swp1', 'swp3']
|
||||
ipv4: '10.1.1.1/24'
|
||||
alias_name: uplink to isp
|
||||
slaves:
|
||||
- swp1
|
||||
- swp3
|
||||
ipv4: 10.1.1.1/24'
|
||||
bond2:
|
||||
vids: [1, 50]
|
||||
vids:
|
||||
- 1
|
||||
- 50
|
||||
clag_id: 1
|
||||
'''
|
||||
|
||||
|
|
|
@ -59,10 +59,7 @@ requirements: ["Cumulus Linux OS"]
|
|||
|
||||
'''
|
||||
EXAMPLES = '''
|
||||
Example playbook entries using the cl_img_install module
|
||||
|
||||
## 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
|
||||
|
@ -83,7 +80,6 @@ Example playbook entries using the cl_img_install module
|
|||
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
|
||||
|
||||
|
@ -92,7 +88,7 @@ Example playbook entries using the cl_img_install module
|
|||
src: ftp://CumulusLinux-2.0.1.bin
|
||||
dest: /root/image.bin
|
||||
|
||||
- name: install image and switch slots. only reboot needed
|
||||
- name: install image and switch slots. Only reboot needed
|
||||
cl_img_install:
|
||||
version: 2.0.1
|
||||
src: /root/image.bin
|
||||
|
|
|
@ -139,7 +139,7 @@ EXAMPLES = '''
|
|||
- name: Configure subinterface with an IP
|
||||
cl_interface:
|
||||
name: bond0.100
|
||||
alias_name: 'my bond'
|
||||
alias_name: my bond
|
||||
ipv4: 10.1.1.1/24
|
||||
notify: reload networking
|
||||
|
||||
|
@ -148,50 +148,49 @@ EXAMPLES = '''
|
|||
# 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) }}"
|
||||
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 }}"
|
||||
with_dict: '{{ cl_interfaces }}'
|
||||
notify: reload networking
|
||||
|
||||
|
||||
# In vars file
|
||||
# ============
|
||||
cl_interfaces:
|
||||
swp1:
|
||||
alias_name: 'uplink to isp'
|
||||
ipv4: '10.1.1.1/24'
|
||||
alias_name: uplink to isp
|
||||
ipv4: 10.1.1.1/24
|
||||
swp2:
|
||||
alias_name: 'l2 trunk connection'
|
||||
vids: [1, 50]
|
||||
alias_name: l2 trunk connection
|
||||
vids:
|
||||
- 1
|
||||
- 50
|
||||
swp3:
|
||||
speed: 1000
|
||||
alias_name: 'connects to 1G link'
|
||||
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'
|
||||
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'
|
||||
|
||||
|
||||
virtual_ip: 10.2.2.254
|
||||
virtual_mac: 00:00:5E:00:10:10
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
|
|
@ -47,24 +47,27 @@ options:
|
|||
- List of 10G ports that will be ganged to form a 40G port.
|
||||
'''
|
||||
EXAMPLES = '''
|
||||
Example playbook entries using the cl_ports module to manage the switch
|
||||
attributes defined in the ports.conf file on Cumulus Linux
|
||||
# Use cl_ports module to manage the switch attributes defined in the
|
||||
# ports.conf file on Cumulus Linux
|
||||
|
||||
## Unganged port config using simple args
|
||||
- name: configure ports.conf setup
|
||||
## Unganged port configuration on certain ports
|
||||
- name: configure ports.conf setup
|
||||
cl_ports:
|
||||
speed_4_by_10g: "swp1, swp32"
|
||||
speed_40g: "swp2-31"
|
||||
notify: restart switchd
|
||||
speed_4_by_10g:
|
||||
- swp1
|
||||
- swp32
|
||||
speed_40g:
|
||||
- swp2-31
|
||||
|
||||
## Unganged port configuration on certain ports using complex args
|
||||
|
||||
- name: configure ports.conf setup
|
||||
## 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']
|
||||
notify: restart switchd
|
||||
|
||||
speed_4_by_10g:
|
||||
- swp1-3
|
||||
- swp6
|
||||
speed_40g:
|
||||
- swp4-5
|
||||
- swp7-32
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
|
Loading…
Reference in a new issue