1
0
Fork 0
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:
Fabio Alessandro Locati 2016-12-09 11:00:34 +00:00 committed by John R Barker
parent e5bc2e0570
commit 013722d974
4 changed files with 69 additions and 67 deletions

View file

@ -152,16 +152,17 @@ EXAMPLES = '''
# configure a bond interface with IP address # configure a bond interface with IP address
- cl_bond: - cl_bond:
name: bond0 name: bond0
slaves: "swp4-5" slaves:
- swp4-5
ipv4: 10.1.1.1/24 ipv4: 10.1.1.1/24
notify: reload networking
# configure bond as a dual-connected clag bond # configure bond as a dual-connected clag bond
- cl_bond: - cl_bond:
name: bond1 name: bond1
slaves: "swp1s0 swp2s0" slaves:
- swp1s0
- swp2s0
clag_id: 1 clag_id: 1
notify: reload networking
# define cl_bond once in tasks file # define cl_bond once in tasks file
# then write interface config in variables file # then write interface config in variables file
@ -182,18 +183,21 @@ EXAMPLES = '''
mstpctl_portadminedge: "{{ item.value.mstpctl_portadminedge|default('no') }}" mstpctl_portadminedge: "{{ item.value.mstpctl_portadminedge|default('no') }}"
mstpctl_bpduguard: "{{ item.value.mstpctl_bpduguard|default('no') }}" mstpctl_bpduguard: "{{ item.value.mstpctl_bpduguard|default('no') }}"
with_dict: "{{ cl_bonds }}" with_dict: "{{ cl_bonds }}"
notify: reload networking
# In vars file # In vars file
# ============ # ============
cl_bonds: cl_bonds:
bond0: bond0:
alias_name: 'uplink to isp' alias_name: uplink to isp
slaves: ['swp1', 'swp3'] slaves:
ipv4: '10.1.1.1/24' - swp1
bond2: - swp3
vids: [1, 50] ipv4: 10.1.1.1/24'
clag_id: 1 bond2:
vids:
- 1
- 50
clag_id: 1
''' '''
RETURN = ''' RETURN = '''

View file

@ -59,10 +59,7 @@ requirements: ["Cumulus Linux OS"]
''' '''
EXAMPLES = ''' EXAMPLES = '''
Example playbook entries using the cl_img_install module
## Download and install the image from a webserver. ## 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 - name: Install image using using http url. Switch slots so the subsequent will load the new version
cl_img_install: cl_img_install:
version: 2.0.1 version: 2.0.1
@ -83,7 +80,6 @@ Example playbook entries using the cl_img_install module
cl_img_install: cl_img_install:
src: /root/CumulusLinux-2.0.1.bin src: /root/CumulusLinux-2.0.1.bin
## If the image name has been changed from the original name, use the `version` option ## 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 ## 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 src: ftp://CumulusLinux-2.0.1.bin
dest: /root/image.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: cl_img_install:
version: 2.0.1 version: 2.0.1
src: /root/image.bin src: /root/image.bin

View file

@ -139,7 +139,7 @@ EXAMPLES = '''
- name: Configure subinterface with an IP - name: Configure subinterface with an IP
cl_interface: cl_interface:
name: bond0.100 name: bond0.100
alias_name: 'my bond' alias_name: my bond
ipv4: 10.1.1.1/24 ipv4: 10.1.1.1/24
notify: reload networking notify: reload networking
@ -148,50 +148,49 @@ EXAMPLES = '''
# with just the options you want. # with just the options you want.
- name: Create interfaces - name: Create interfaces
cl_interface: cl_interface:
name: "{{ item.key }}" name: '{{ item.key }}'
ipv4: "{{ item.value.ipv4 | default(omit) }}" ipv4: '{{ item.value.ipv4 | default(omit) }}'
ipv6: "{{ item.value.ipv6 | default(omit) }}" ipv6: '{{ item.value.ipv6 | default(omit) }}'
alias_name: "{{ item.value.alias_name | default(omit) }}" alias_name: '{{ item.value.alias_name | default(omit) }}'
addr_method: "{{ item.value.addr_method | default(omit) }}" addr_method: '{{ item.value.addr_method | default(omit) }}'
speed: "{{ item.value.link_speed | default(omit) }}" speed: '{{ item.value.link_speed | default(omit) }}'
mtu: "{{ item.value.mtu | default(omit) }}" mtu: '{{ item.value.mtu | default(omit) }}'
clagd_enable: "{{ item.value.clagd_enable | default(omit) }}" clagd_enable: '{{ item.value.clagd_enable | default(omit) }}'
clagd_peer_ip: "{{ item.value.clagd_peer_ip | default(omit) }}" clagd_peer_ip: '{{ item.value.clagd_peer_ip | default(omit) }}'
clagd_sys_mac: "{{ item.value.clagd_sys_mac | default(omit) }}" clagd_sys_mac: '{{ item.value.clagd_sys_mac | default(omit) }}'
clagd_priority: "{{ item.value.clagd_priority | default(omit) }}" clagd_priority: '{{ item.value.clagd_priority | default(omit) }}'
vids: "{{ item.value.vids | default(omit) }}" vids: '{{ item.value.vids | default(omit) }}'
virtual_ip: "{{ item.value.virtual_ip | default(omit) }}" virtual_ip: '{{ item.value.virtual_ip | default(omit) }}'
virtual_mac: "{{ item.value.virtual_mac | default(omit) }}" virtual_mac: '{{ item.value.virtual_mac | default(omit) }}'
mstpctl_portnetwork: "{{ item.value.mstpctl_portnetwork | default('no') }}" mstpctl_portnetwork: "{{ item.value.mstpctl_portnetwork | default('no') }}"
mstpctl_portadminedge: "{{ item.value.mstpctl_portadminedge | default('no') }}" mstpctl_portadminedge: "{{ item.value.mstpctl_portadminedge | default('no') }}"
mstpctl_bpduguard: "{{ item.value.mstpctl_bpduguard | default('no') }}" mstpctl_bpduguard: "{{ item.value.mstpctl_bpduguard | default('no') }}"
with_dict: "{{ cl_interfaces }}" with_dict: '{{ cl_interfaces }}'
notify: reload networking notify: reload networking
# In vars file # In vars file
# ============ # ============
cl_interfaces: cl_interfaces:
swp1: swp1:
alias_name: 'uplink to isp' alias_name: uplink to isp
ipv4: '10.1.1.1/24' ipv4: 10.1.1.1/24
swp2: swp2:
alias_name: 'l2 trunk connection' alias_name: l2 trunk connection
vids: [1, 50] vids:
swp3: - 1
speed: 1000 - 50
alias_name: 'connects to 1G link' swp3:
speed: 1000
alias_name: connects to 1G link
########## ##########
# br0 interface is configured by cl_bridge # br0 interface is configured by cl_bridge
########## ##########
br0.100: br0.100:
alias_name: 'SVI for vlan 100' alias_name: SVI for vlan 100
ipv4: '10.2.2.2/24' ipv4: 10.2.2.2/24
ipv6: '10:2:2::2/127' ipv6: '10:2:2::2/127'
virtual_ip: '10.2.2.254' virtual_ip: 10.2.2.254
virtual_mac: '00:00:5E:00:10:10' virtual_mac: 00:00:5E:00:10:10
''' '''
RETURN = ''' RETURN = '''

View file

@ -47,24 +47,27 @@ options:
- List of 10G ports that will be ganged to form a 40G port. - List of 10G ports that will be ganged to form a 40G port.
''' '''
EXAMPLES = ''' EXAMPLES = '''
Example playbook entries using the cl_ports module to manage the switch # Use cl_ports module to manage the switch attributes defined in the
attributes defined in the ports.conf file on Cumulus Linux # ports.conf file on Cumulus Linux
## Unganged port config using simple args ## Unganged port configuration on certain ports
- name: configure ports.conf setup - name: configure ports.conf setup
cl_ports: cl_ports:
speed_4_by_10g: "swp1, swp32" speed_4_by_10g:
speed_40g: "swp2-31" - swp1
notify: restart switchd - swp32
speed_40g:
## Unganged port configuration on certain ports using complex args - swp2-31
- name: configure ports.conf setup
cl_ports:
speed_4_by_10g: ['swp1-3', 'swp6']
speed_40g: ['swp4-5', 'swp7-32']
notify: restart switchd
## 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 = ''' RETURN = '''