Native YAML - Network (#3587)
* Fix citrix native yaml * Fix snmp native yaml and connectio * Fix more native syntax * More native syntax * Fix openvswitch native syntax * More YAML code ! * More fixes * Improve nmcli
This commit is contained in:
parent
d092d53198
commit
cb1b8edfa9
15 changed files with 424 additions and 136 deletions
|
@ -87,13 +87,26 @@ author: "Nandor Sivok (@dominis)"
|
|||
|
||||
EXAMPLES = '''
|
||||
# Disable the server
|
||||
ansible host -m netscaler -a "nsc_host=nsc.example.com user=apiuser password=apipass"
|
||||
- netscaler:
|
||||
nsc_host: nsc.example.com
|
||||
user: apiuser
|
||||
password: apipass
|
||||
|
||||
# Enable the server
|
||||
ansible host -m netscaler -a "nsc_host=nsc.example.com user=apiuser password=apipass action=enable"
|
||||
- netscaler:
|
||||
nsc_host: nsc.example.com
|
||||
user: apiuser
|
||||
password: apipass
|
||||
action: enable
|
||||
|
||||
# Disable the service local:8080
|
||||
ansible host -m netscaler -a "nsc_host=nsc.example.com user=apiuser password=apipass name=local:8080 type=service action=disable"
|
||||
- netscaler:
|
||||
nsc_host: nsc.example.com
|
||||
user: apiuser
|
||||
password: apipass
|
||||
name: 'local:8080'
|
||||
type: service
|
||||
action: disable
|
||||
'''
|
||||
|
||||
|
||||
|
|
|
@ -97,36 +97,67 @@ author: Alex Coomans
|
|||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
# authenticate using email and API token
|
||||
- local_action: dnsimple account_email=test@example.com account_api_token=dummyapitoken
|
||||
|
||||
# fetch all domains
|
||||
- local_action dnsimple
|
||||
register: domains
|
||||
# authenticate using email and API token and fetch all domains
|
||||
- dnsimple:
|
||||
account_email: test@example.com
|
||||
account_api_token: dummyapitoken
|
||||
delegate_to: localhost
|
||||
|
||||
# fetch my.com domain records
|
||||
- local_action: dnsimple domain=my.com state=present
|
||||
- dnsimple:
|
||||
domain: my.com
|
||||
state: present
|
||||
delegate_to: localhost
|
||||
register: records
|
||||
|
||||
# delete a domain
|
||||
- local_action: dnsimple domain=my.com state=absent
|
||||
- dnsimple:
|
||||
domain: my.com
|
||||
state: absent
|
||||
delegate_to: localhost
|
||||
|
||||
# create a test.my.com A record to point to 127.0.0.01
|
||||
- local_action: dnsimple domain=my.com record=test type=A value=127.0.0.1
|
||||
- dnsimple:
|
||||
domain: my.com
|
||||
record: test
|
||||
type: A
|
||||
value: 127.0.0.1
|
||||
delegate_to: localhost
|
||||
register: record
|
||||
|
||||
# and then delete it
|
||||
- local_action: dnsimple domain=my.com record_ids={{ record['id'] }}
|
||||
- dnsimple:
|
||||
domain: my.com
|
||||
record_ids: '{{ record["id"] }}'
|
||||
delegate_to: localhost
|
||||
|
||||
# create a my.com CNAME record to example.com
|
||||
- local_action: dnsimple domain=my.com record= type=CNAME value=example.com state=present
|
||||
- dnsimple
|
||||
domain: my.com
|
||||
record: ''
|
||||
type: CNAME
|
||||
value: example.com
|
||||
state: present
|
||||
delegate_to: localhost
|
||||
|
||||
# change it's ttl
|
||||
- local_action: dnsimple domain=my.com record= type=CNAME value=example.com ttl=600 state=present
|
||||
- dnsimple:
|
||||
domain: my.com
|
||||
record: ''
|
||||
type: CNAME
|
||||
value: example.com
|
||||
ttl: 600
|
||||
state: present
|
||||
delegate_to: localhost
|
||||
|
||||
# and delete the record
|
||||
- local_action: dnsimpledomain=my.com record= type=CNAME value=example.com state=absent
|
||||
|
||||
- dnsimple:
|
||||
domain: my.com
|
||||
record: ''
|
||||
type: CNAME
|
||||
value: example.com
|
||||
state: absent
|
||||
delegate_to: localhost
|
||||
'''
|
||||
|
||||
import os
|
||||
|
|
|
@ -92,21 +92,48 @@ author: "Brice Burgess (@briceburg)"
|
|||
|
||||
EXAMPLES = '''
|
||||
# fetch my.com domain records
|
||||
- dnsmadeeasy: account_key=key account_secret=secret domain=my.com state=present
|
||||
- dnsmadeeasy:
|
||||
account_key: key
|
||||
account_secret: secret
|
||||
domain: my.com
|
||||
state: present
|
||||
register: response
|
||||
|
||||
# create / ensure the presence of a record
|
||||
- dnsmadeeasy: account_key=key account_secret=secret domain=my.com state=present record_name="test" record_type="A" record_value="127.0.0.1"
|
||||
- dnsmadeeasy:
|
||||
account_key: key
|
||||
account_secret: secret
|
||||
domain: my.com
|
||||
state: present
|
||||
record_name: test
|
||||
record_type: A
|
||||
record_value: 127.0.0.1
|
||||
|
||||
# update the previously created record
|
||||
- dnsmadeeasy: account_key=key account_secret=secret domain=my.com state=present record_name="test" record_value="192.168.0.1"
|
||||
- dnsmadeeasy:
|
||||
account_key: key
|
||||
account_secret: secret
|
||||
domain: my.com
|
||||
state: present
|
||||
record_name: test
|
||||
record_value: 192.0.2.23
|
||||
|
||||
# fetch a specific record
|
||||
- dnsmadeeasy: account_key=key account_secret=secret domain=my.com state=present record_name="test"
|
||||
- dnsmadeeasy:
|
||||
account_key: key
|
||||
account_secret: secret
|
||||
domain: my.com
|
||||
state: present
|
||||
record_name: test
|
||||
register: response
|
||||
|
||||
# delete a record / ensure it is absent
|
||||
- dnsmadeeasy: account_key=key account_secret=secret domain=my.com state=absent record_name="test"
|
||||
- dnsmadeeasy:
|
||||
account_key: key
|
||||
account_secret: secret
|
||||
domain: my.com
|
||||
state: absent
|
||||
record_name: test
|
||||
'''
|
||||
|
||||
# ============================================
|
||||
|
|
|
@ -23,6 +23,7 @@ DOCUMENTATION = '''
|
|||
module: haproxy
|
||||
version_added: "1.9"
|
||||
short_description: Enable, disable, and set weights for HAProxy backend servers using socket commands.
|
||||
author: "Ravi Bhure (@ravibhure)"
|
||||
description:
|
||||
- Enable, disable, and set weights for HAProxy backend servers using socket
|
||||
commands.
|
||||
|
@ -97,36 +98,74 @@ options:
|
|||
|
||||
EXAMPLES = '''
|
||||
# disable server in 'www' backend pool
|
||||
- haproxy: state=disabled host={{ inventory_hostname }} backend=www
|
||||
- haproxy:
|
||||
state: disabled
|
||||
host: '{{ inventory_hostname }}'
|
||||
backend: www
|
||||
|
||||
# disable server without backend pool name (apply to all available backend pool)
|
||||
- haproxy: state=disabled host={{ inventory_hostname }}
|
||||
- haproxy:
|
||||
state: disabled
|
||||
host: '{{ inventory_hostname }}'
|
||||
|
||||
# disable server, provide socket file
|
||||
- haproxy: state=disabled host={{ inventory_hostname }} socket=/var/run/haproxy.sock backend=www
|
||||
- haproxy:
|
||||
state: disabled
|
||||
host: '{{ inventory_hostname }}'
|
||||
socket: /var/run/haproxy.sock
|
||||
backend: www
|
||||
|
||||
# disable server, provide socket file, wait until status reports in maintenance
|
||||
- haproxy: state=disabled host={{ inventory_hostname }} socket=/var/run/haproxy.sock backend=www wait=yes
|
||||
- haproxy:
|
||||
state: disabled
|
||||
host: '{{ inventory_hostname }}'
|
||||
socket: /var/run/haproxy.sock
|
||||
backend: www
|
||||
wait: yes
|
||||
|
||||
# disable backend server in 'www' backend pool and drop open sessions to it
|
||||
- haproxy: state=disabled host={{ inventory_hostname }} backend=www socket=/var/run/haproxy.sock shutdown_sessions=true
|
||||
- haproxy:
|
||||
state: disabled
|
||||
host: '{{ inventory_hostname }}'
|
||||
backend: www
|
||||
socket: /var/run/haproxy.sock
|
||||
shutdown_sessions: true
|
||||
|
||||
# disable server without backend pool name (apply to all available backend pool) but fail when the backend host is not found
|
||||
- haproxy: state=disabled host={{ inventory_hostname }} fail_on_not_found=yes
|
||||
- haproxy:
|
||||
state: disabled
|
||||
host: '{{ inventory_hostname }}'
|
||||
fail_on_not_found: yes
|
||||
|
||||
# enable server in 'www' backend pool
|
||||
- haproxy: state=enabled host={{ inventory_hostname }} backend=www
|
||||
- haproxy:
|
||||
state: enabled
|
||||
host: '{{ inventory_hostname }}'
|
||||
backend: www
|
||||
|
||||
# enable server in 'www' backend pool wait until healthy
|
||||
- haproxy: state=enabled host={{ inventory_hostname }} backend=www wait=yes
|
||||
- haproxy:
|
||||
state: enabled
|
||||
host: '{{ inventory_hostname }}'
|
||||
backend: www
|
||||
wait: yes
|
||||
|
||||
# enable server in 'www' backend pool wait until healthy. Retry 10 times with intervals of 5 seconds to retrieve the health
|
||||
- haproxy: state=enabled host={{ inventory_hostname }} backend=www wait=yes wait_retries=10 wait_interval=5
|
||||
- haproxy:
|
||||
state: enabled
|
||||
host: '{{ inventory_hostname }}'
|
||||
backend: www
|
||||
wait: yes
|
||||
wait_retries: 10
|
||||
wait_interval: 5
|
||||
|
||||
# enable server in 'www' backend pool with change server(s) weight
|
||||
- haproxy: state=enabled host={{ inventory_hostname }} socket=/var/run/haproxy.sock weight=10 backend=www
|
||||
|
||||
author: "Ravi Bhure (@ravibhure)"
|
||||
- haproxy:
|
||||
state: enabled
|
||||
host: '{{ inventory_hostname }}'
|
||||
socket: /var/run/haproxy.sock
|
||||
weight: 10
|
||||
backend: www
|
||||
'''
|
||||
|
||||
import socket
|
||||
|
|
|
@ -49,10 +49,14 @@ options:
|
|||
|
||||
EXAMPLES = '''
|
||||
# Create 'stub0' etherstub
|
||||
dladm_etherstub: name=stub0 state=present
|
||||
- dladm_etherstub:
|
||||
name: stub0
|
||||
state: present
|
||||
|
||||
# Remove 'stub0 etherstub
|
||||
dladm_etherstub: name=stub0 state=absent
|
||||
- dladm_etherstub:
|
||||
name: stub0
|
||||
state: absent
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
|
|
@ -66,13 +66,23 @@ options:
|
|||
|
||||
EXAMPLES = '''
|
||||
# Create 'vnic0' VNIC over 'bnx0' link
|
||||
dladm_vnic: name=vnic0 link=bnx0 state=present
|
||||
- dladm_vnic:
|
||||
name: vnic0
|
||||
link: bnx0
|
||||
state: present
|
||||
|
||||
# Create VNIC with specified MAC and VLAN tag over 'aggr0'
|
||||
dladm_vnic: name=vnic1 link=aggr0 mac=2:33:af:12:ab:cd vlan=4
|
||||
- dladm_vnic:
|
||||
name: vnic1
|
||||
link: aggr0
|
||||
mac: '00:00:5E:00:53:23'
|
||||
vlan: 4
|
||||
|
||||
# Remove 'vnic0' VNIC
|
||||
dladm_vnic: name=vnic0 link=bnx0 state=absent
|
||||
- dladm_vnic:
|
||||
name: vnic0
|
||||
link: bnx0
|
||||
state: absent
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
|
|
@ -92,13 +92,27 @@ options:
|
|||
|
||||
EXAMPLES = '''
|
||||
# Limit SSH traffic to 100M via vnic0 interface
|
||||
flowadm: link=vnic0 flow=ssh_out transport=tcp local_port=22 maxbw=100M state=present
|
||||
- flowadm:
|
||||
link: vnic0
|
||||
flow: ssh_out
|
||||
transport: tcp
|
||||
local_port: 22
|
||||
maxbw: 100M
|
||||
state: present
|
||||
|
||||
# Reset flow properties
|
||||
flowadm: name=dns state=resetted
|
||||
- flowadm:
|
||||
name: dns
|
||||
state: resetted
|
||||
|
||||
# Configure policy for EF PHB (DSCP value of 101110 from RFC 2598) with a bandwidth of 500 Mbps and a high priority.
|
||||
flowadm: link=bge0 dsfield=0x2e:0xfc maxbw=500M priority=high flow=efphb-flow state=present
|
||||
- flowadm:
|
||||
link: bge0
|
||||
dsfield: '0x2e:0xfc'
|
||||
maxbw: 500M
|
||||
priority: high
|
||||
flow: efphb-flow
|
||||
state: present
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
|
|
@ -50,10 +50,14 @@ options:
|
|||
|
||||
EXAMPLES = '''
|
||||
# Create vnic0 interface
|
||||
ipadm_if: name=vnic0 state=enabled
|
||||
- ipadm_if:
|
||||
name: vnic0
|
||||
state: enabled
|
||||
|
||||
# Disable vnic0 interface
|
||||
ipadm_if: name=vnic0 state=disabled
|
||||
- ipadm_if:
|
||||
name: vnic0
|
||||
state: disabled
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
|
|
@ -36,7 +36,8 @@ EXAMPLES = '''
|
|||
lldp:
|
||||
|
||||
- name: Print each switch/port
|
||||
debug: msg="{{ lldp[item]['chassis']['name'] }} / {{ lldp[item]['port']['ifalias'] }}
|
||||
debug:
|
||||
msg: "{{ lldp[item]['chassis']['name'] }} / {{ lldp[item]['port']['ifalias'] }}"
|
||||
with_items: "{{ lldp.keys() }}"
|
||||
|
||||
# TASK: [Print each switch/port] ***********************************************************
|
||||
|
|
|
@ -234,32 +234,75 @@ tenant_gw: "172.100.0.254"
|
|||
|
||||
#Team vars
|
||||
nmcli_team:
|
||||
- {conn_name: 'tenant', ip4: "{{tenant_ip}}", gw4: "{{tenant_gw}}"}
|
||||
- {conn_name: 'external', ip4: "{{external_ip}}", gw4: "{{external_gw}}"}
|
||||
- {conn_name: 'storage', ip4: "{{storage_ip}}", gw4: "{{storage_gw}}"}
|
||||
- conn_name: tenant
|
||||
ip4: '{{ tenant_ip }}'
|
||||
gw4: '{{ tenant_gw }}'
|
||||
- conn_name: external
|
||||
ip4: '{{ external_ip }}'
|
||||
gw4: '{{ external_gw }}'
|
||||
- conn_name: storage
|
||||
ip4: '{{ storage_ip }}'
|
||||
gw4: '{{ storage_gw }}'
|
||||
nmcli_team_slave:
|
||||
- {conn_name: 'em1', ifname: 'em1', master: 'tenant'}
|
||||
- {conn_name: 'em2', ifname: 'em2', master: 'tenant'}
|
||||
- {conn_name: 'p2p1', ifname: 'p2p1', master: 'storage'}
|
||||
- {conn_name: 'p2p2', ifname: 'p2p2', master: 'external'}
|
||||
- conn_name: em1
|
||||
ifname: em1
|
||||
master: tenant
|
||||
- conn_name: em2
|
||||
ifname: em2
|
||||
master: tenant
|
||||
- conn_name: p2p1
|
||||
ifname: p2p1
|
||||
master: storage
|
||||
- conn_name: p2p2
|
||||
ifname: p2p2
|
||||
master: external
|
||||
|
||||
#bond vars
|
||||
nmcli_bond:
|
||||
- {conn_name: 'tenant', ip4: "{{tenant_ip}}", gw4: '', mode: 'balance-rr'}
|
||||
- {conn_name: 'external', ip4: "{{external_ip}}", gw4: '', mode: 'balance-rr'}
|
||||
- {conn_name: 'storage', ip4: "{{storage_ip}}", gw4: "{{storage_gw}}", mode: 'balance-rr'}
|
||||
- conn_name: tenant
|
||||
ip4: '{{ tenant_ip }}'
|
||||
gw4: ''
|
||||
mode: balance-rr
|
||||
- conn_name: external
|
||||
ip4: '{{ external_ip }}'
|
||||
gw4: ''
|
||||
mode: balance-rr
|
||||
- conn_name: storage
|
||||
ip4: '{{ storage_ip }}'
|
||||
gw4: '{{ storage_gw }}'
|
||||
mode: balance-rr
|
||||
nmcli_bond_slave:
|
||||
- {conn_name: 'em1', ifname: 'em1', master: 'tenant'}
|
||||
- {conn_name: 'em2', ifname: 'em2', master: 'tenant'}
|
||||
- {conn_name: 'p2p1', ifname: 'p2p1', master: 'storage'}
|
||||
- {conn_name: 'p2p2', ifname: 'p2p2', master: 'external'}
|
||||
- conn_name: em1
|
||||
ifname: em1
|
||||
master: tenant
|
||||
- conn_name: em2
|
||||
ifname: em2
|
||||
master: tenant
|
||||
- conn_name: p2p1
|
||||
ifname: p2p1
|
||||
master: storage
|
||||
- conn_name: p2p2
|
||||
ifname: p2p2
|
||||
master: external
|
||||
|
||||
#ethernet vars
|
||||
nmcli_ethernet:
|
||||
- {conn_name: 'em1', ifname: 'em1', ip4: "{{tenant_ip}}", gw4: "{{tenant_gw}}"}
|
||||
- {conn_name: 'em2', ifname: 'em2', ip4: "{{tenant_ip1}}", gw4: "{{tenant_gw}}"}
|
||||
- {conn_name: 'p2p1', ifname: 'p2p1', ip4: "{{storage_ip}}", gw4: "{{storage_gw}}"}
|
||||
- {conn_name: 'p2p2', ifname: 'p2p2', ip4: "{{external_ip}}", gw4: "{{external_gw}}"}
|
||||
- conn_name: em1
|
||||
ifname: em1
|
||||
ip4: '{{ tenant_ip }}'
|
||||
gw4: '{{ tenant_gw }}'
|
||||
- conn_name: em2
|
||||
ifname: em2
|
||||
ip4: '{{ tenant_ip1 }}'
|
||||
gw4: '{{ tenant_gw }}'
|
||||
- conn_name: p2p1
|
||||
ifname: p2p1
|
||||
ip4: '{{ storage_ip }}'
|
||||
gw4: '{{ storage_gw }}'
|
||||
- conn_name: p2p2
|
||||
ifname: p2p2
|
||||
ip4: '{{ external_ip }}'
|
||||
gw4: '{{ external_gw }}'
|
||||
```
|
||||
|
||||
### host_vars
|
||||
|
@ -280,8 +323,10 @@ tenant_ip: "192.168.200.21/23"
|
|||
remote_user: root
|
||||
tasks:
|
||||
|
||||
- name: install needed network manager libs
|
||||
yum: name={{ item }} state=installed
|
||||
- name: install needed network manager libs
|
||||
yum:
|
||||
name: '{{ item }}'
|
||||
state: installed
|
||||
with_items:
|
||||
- NetworkManager-glib
|
||||
- libnm-qt-devel.x86_64
|
||||
|
@ -291,31 +336,57 @@ tenant_ip: "192.168.200.21/23"
|
|||
|
||||
##### Working with all cloud nodes - Teaming
|
||||
- name: try nmcli add team - conn_name only & ip4 gw4
|
||||
nmcli: type=team conn_name={{item.conn_name}} ip4={{item.ip4}} gw4={{item.gw4}} state=present
|
||||
nmcli:
|
||||
type: team
|
||||
conn_name: '{{ item.conn_name }}'
|
||||
ip4: '{{ item.ip4 }}'
|
||||
gw4: '{{ item.gw4 }}'
|
||||
state: present
|
||||
with_items:
|
||||
- "{{nmcli_team}}"
|
||||
- '{{ nmcli_team }}'
|
||||
|
||||
- name: try nmcli add teams-slave
|
||||
nmcli: type=team-slave conn_name={{item.conn_name}} ifname={{item.ifname}} master={{item.master}} state=present
|
||||
nmcli:
|
||||
type: team-slave
|
||||
conn_name: '{{ item.conn_name }}'
|
||||
ifname: '{{ item.ifname }}'
|
||||
master: '{{ item.master }}'
|
||||
state: present
|
||||
with_items:
|
||||
- "{{nmcli_team_slave}}"
|
||||
- '{{ nmcli_team_slave }}'
|
||||
|
||||
###### Working with all cloud nodes - Bonding
|
||||
# - name: try nmcli add bond - conn_name only & ip4 gw4 mode
|
||||
# nmcli: type=bond conn_name={{item.conn_name}} ip4={{item.ip4}} gw4={{item.gw4}} mode={{item.mode}} state=present
|
||||
# nmcli:
|
||||
# type: bond
|
||||
# conn_name: '{{ item.conn_name }}'
|
||||
# ip4: '{{ item.ip4 }}'
|
||||
# gw4: '{{ item.gw4 }}'
|
||||
# mode: '{{ item.mode }}'
|
||||
# state: present
|
||||
# with_items:
|
||||
# - "{{nmcli_bond}}"
|
||||
# - '{{ nmcli_bond }}'
|
||||
#
|
||||
# - name: try nmcli add bond-slave
|
||||
# nmcli: type=bond-slave conn_name={{item.conn_name}} ifname={{item.ifname}} master={{item.master}} state=present
|
||||
# nmcli:
|
||||
# type: bond-slave
|
||||
# conn_name: '{{ item.conn_name }}'
|
||||
# ifname: '{{ item.ifname }}'
|
||||
# master: '{{ item.master }}'
|
||||
# state: present
|
||||
# with_items:
|
||||
# - "{{nmcli_bond_slave}}"
|
||||
# - '{{ nmcli_bond_slave }}'
|
||||
|
||||
##### Working with all cloud nodes - Ethernet
|
||||
# - name: nmcli add Ethernet - conn_name only & ip4 gw4
|
||||
# nmcli: type=ethernet conn_name={{item.conn_name}} ip4={{item.ip4}} gw4={{item.gw4}} state=present
|
||||
# nmcli:
|
||||
# type: ethernet
|
||||
# conn_name: '{{ item.conn_name }}'
|
||||
# ip4: '{{ item.ip4 }}'
|
||||
# gw4: '{{ item.gw4 }}'
|
||||
# state: present
|
||||
# with_items:
|
||||
# - "{{nmcli_ethernet}}"
|
||||
# - '{{ nmcli_ethernet }}'
|
||||
```
|
||||
|
||||
## playbook-del.yml example
|
||||
|
@ -327,41 +398,77 @@ tenant_ip: "192.168.200.21/23"
|
|||
tasks:
|
||||
|
||||
- name: try nmcli del team - multiple
|
||||
nmcli: conn_name={{item.conn_name}} state=absent
|
||||
nmcli:
|
||||
conn_name: '{{ item.conn_name }}'
|
||||
state: absent
|
||||
with_items:
|
||||
- { conn_name: 'em1'}
|
||||
- { conn_name: 'em2'}
|
||||
- { conn_name: 'p1p1'}
|
||||
- { conn_name: 'p1p2'}
|
||||
- { conn_name: 'p2p1'}
|
||||
- { conn_name: 'p2p2'}
|
||||
- { conn_name: 'tenant'}
|
||||
- { conn_name: 'storage'}
|
||||
- { conn_name: 'external'}
|
||||
- { conn_name: 'team-em1'}
|
||||
- { conn_name: 'team-em2'}
|
||||
- { conn_name: 'team-p1p1'}
|
||||
- { conn_name: 'team-p1p2'}
|
||||
- { conn_name: 'team-p2p1'}
|
||||
- { conn_name: 'team-p2p2'}
|
||||
- conn_name: em1
|
||||
- conn_name: em2
|
||||
- conn_name: p1p1
|
||||
- conn_name: p1p2
|
||||
- conn_name: p2p1
|
||||
- conn_name: p2p2
|
||||
- conn_name: tenant
|
||||
- conn_name: storage
|
||||
- conn_name: external
|
||||
- conn_name: team-em1
|
||||
- conn_name: team-em2
|
||||
- conn_name: team-p1p1
|
||||
- conn_name: team-p1p2
|
||||
- conn_name: team-p2p1
|
||||
- conn_name: team-p2p2
|
||||
```
|
||||
# To add an Ethernet connection with static IP configuration, issue a command as follows
|
||||
- nmcli: conn_name=my-eth1 ifname=eth1 type=ethernet ip4=192.168.100.100/24 gw4=192.168.100.1 state=present
|
||||
- nmcli:
|
||||
conn_name: my-eth1
|
||||
ifname: eth1
|
||||
type: ethernet
|
||||
ip4: 192.0.2.100/24
|
||||
gw4: 192.0.2.1
|
||||
state: present
|
||||
|
||||
# To add an Team connection with static IP configuration, issue a command as follows
|
||||
- nmcli: conn_name=my-team1 ifname=my-team1 type=team ip4=192.168.100.100/24 gw4=192.168.100.1 state=present autoconnect=yes
|
||||
- nmcli:
|
||||
conn_name: my-team1
|
||||
ifname: my-team1
|
||||
type: team
|
||||
ip4: 192.0.2.100/24
|
||||
gw4: 192.0.2.1
|
||||
state: present
|
||||
autoconnect: yes
|
||||
|
||||
# Optionally, at the same time specify IPv6 addresses for the device as follows:
|
||||
- nmcli: conn_name=my-eth1 ifname=eth1 type=ethernet ip4=192.168.100.100/24 gw4=192.168.100.1 ip6=abbe::cafe gw6=2001:db8::1 state=present
|
||||
- nmcli:
|
||||
conn_name: my-eth1
|
||||
ifname: eth1
|
||||
type: ethernet
|
||||
ip4: 192.0.2.100/24
|
||||
gw4: 192.0.2.1
|
||||
ip6: '2001:db8::cafe'
|
||||
gw6: '2001:db8::1'
|
||||
state: present
|
||||
|
||||
# To add two IPv4 DNS server addresses:
|
||||
-nmcli: conn_name=my-eth1 dns4=["8.8.8.8", "8.8.4.4"] state=present
|
||||
- nmcli:
|
||||
conn_name: my-eth1
|
||||
dns4:
|
||||
- 192.0.2.53
|
||||
- 198.51.100.53
|
||||
state: present
|
||||
|
||||
# To make a profile usable for all compatible Ethernet interfaces, issue a command as follows
|
||||
- nmcli: ctype=ethernet name=my-eth1 ifname="*" state=present
|
||||
- nmcli:
|
||||
ctype: ethernet
|
||||
name: my-eth1
|
||||
ifname: *
|
||||
state: present
|
||||
|
||||
# To change the property of a setting e.g. MTU, issue a command as follows:
|
||||
- nmcli: conn_name=my-eth1 mtu=9000 type=ethernet state=present
|
||||
- nmcli:
|
||||
conn_name: my-eth1
|
||||
mtu: 9000
|
||||
type: ethernet
|
||||
state: present
|
||||
|
||||
Exit Status's:
|
||||
- nmcli exits with status 0 if it succeeds, a value greater than 0 is
|
||||
|
|
|
@ -77,16 +77,25 @@ options:
|
|||
|
||||
EXAMPLES = '''
|
||||
# Create a bridge named br-int
|
||||
- openvswitch_bridge: bridge=br-int state=present
|
||||
- openvswitch_bridge:
|
||||
bridge: br-int
|
||||
state: present
|
||||
|
||||
# Create a fake bridge named br-int within br-parent on the VLAN 405
|
||||
- openvswitch_bridge: bridge=br-int parent=br-parent vlan=405 state=present
|
||||
- openvswitch_bridge:
|
||||
bridge: br-int
|
||||
parent: br-parent
|
||||
vlan: 405
|
||||
state: present
|
||||
|
||||
# Create an integration bridge
|
||||
- openvswitch_bridge: bridge=br-int state=present fail_mode=secure
|
||||
- openvswitch_bridge:
|
||||
bridge: br-int
|
||||
state: present
|
||||
fail_mode: secure
|
||||
args:
|
||||
external_ids:
|
||||
bridge-id: "br-int"
|
||||
bridge-id: br-int
|
||||
'''
|
||||
|
||||
|
||||
|
|
|
@ -63,12 +63,20 @@ options:
|
|||
EXAMPLES = '''
|
||||
# Increase the maximum idle time to 50 seconds before pruning unused kernel
|
||||
# rules.
|
||||
- openvswitch_db: table=open_vswitch record=. col=other_config key=max-idle
|
||||
value=50000
|
||||
- openvswitch_db:
|
||||
table: open_vswitch
|
||||
record: .
|
||||
col: other_config
|
||||
key: max-idle
|
||||
value: 50000
|
||||
|
||||
# Disable in band copy
|
||||
- openvswitch_db: table=Bridge record=br-int col=other_config
|
||||
key=disable-in-band value=true
|
||||
- openvswitch_db:
|
||||
table: Bridge
|
||||
record: br-int
|
||||
col: other_config
|
||||
key: disable-in-band
|
||||
value: true
|
||||
'''
|
||||
|
||||
|
||||
|
|
|
@ -72,25 +72,38 @@ options:
|
|||
|
||||
EXAMPLES = '''
|
||||
# Creates port eth2 on bridge br-ex
|
||||
- openvswitch_port: bridge=br-ex port=eth2 state=present
|
||||
- openvswitch_port:
|
||||
bridge: br-ex
|
||||
port: eth2
|
||||
state: present
|
||||
|
||||
# Creates port eth6 and set ofport equal to 6.
|
||||
- openvswitch_port: bridge=bridge-loop port=eth6 state=present
|
||||
set="Interface eth6 ofport_request=6"
|
||||
# Creates port eth6
|
||||
- openvswitch_port:
|
||||
bridge: bridge-loop
|
||||
port: eth6
|
||||
state: present
|
||||
set: Interface eth6
|
||||
|
||||
# Creates port vlan10 with tag 10 on bridge br-ex
|
||||
- openvswitch_port: bridge=br-ex port=vlan10 tag=10 state=present
|
||||
set="Interface vlan10 type=internal"
|
||||
- openvswitch_port:
|
||||
bridge: br-ex
|
||||
port: vlan10
|
||||
tag: 10
|
||||
state: present
|
||||
set: Interface vlan10
|
||||
|
||||
# Assign interface id server1-vifeth6 and mac address 52:54:00:30:6d:11
|
||||
# to port vifeth6 and setup port to be managed by a controller.
|
||||
- openvswitch_port: bridge=br-int port=vifeth6 state=present
|
||||
- openvswitch_port:
|
||||
bridge: br-int
|
||||
port: vifeth6
|
||||
state: present
|
||||
args:
|
||||
external_ids:
|
||||
iface-id: "{{inventory_hostname}}-vifeth6"
|
||||
attached-mac: "52:54:00:30:6d:11"
|
||||
vm-id: "{{inventory_hostname}}"
|
||||
iface-status: "active"
|
||||
iface-id: '{{ inventory_hostname }}-vifeth6'
|
||||
attached-mac: '00:00:5E:00:53:23'
|
||||
vm-id: '{{ inventory_hostname }}'
|
||||
iface-status: active
|
||||
'''
|
||||
|
||||
# pylint: disable=W0703
|
||||
|
|
|
@ -72,19 +72,22 @@ options:
|
|||
|
||||
EXAMPLES = '''
|
||||
# Gather facts with SNMP version 2
|
||||
- snmp_facts: host={{ inventory_hostname }} version=2c community=public
|
||||
connection: local
|
||||
- snmp_facts:
|
||||
host: '{{ inventory_hostname }}'
|
||||
version: 2c
|
||||
community: public
|
||||
delegate_to: local
|
||||
|
||||
# Gather facts using SNMP version 3
|
||||
- snmp_facts:
|
||||
host={{ inventory_hostname }}
|
||||
version=v3
|
||||
level=authPriv
|
||||
integrity=sha
|
||||
privacy=aes
|
||||
username=snmp-user
|
||||
authkey=abc12345
|
||||
privkey=def6789
|
||||
host: '{{ inventory_hostname }}'
|
||||
version: v3
|
||||
level: authPriv
|
||||
integrity: sha
|
||||
privacy: aes
|
||||
username: snmp-user
|
||||
authkey: abc12345
|
||||
privkey: def6789
|
||||
delegate_to: localhost
|
||||
'''
|
||||
|
||||
|
|
|
@ -53,10 +53,15 @@ notes:
|
|||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
# Send a magic Wake-on-LAN packet to 00:CA:FE:BA:BE:00
|
||||
- local_action: wakeonlan mac=00:CA:FE:BA:BE:00 broadcast=192.168.1.255
|
||||
# Send a magic Wake-on-LAN packet to 00:00:5E:00:53:66
|
||||
- wakeonlan:
|
||||
mac: '00:00:5E:00:53:66'
|
||||
broadcast: 192.0.2.23
|
||||
delegate_to: loclahost
|
||||
|
||||
- wakeonlan: mac=00:CA:FE:BA:BE:00 port=9
|
||||
- wakeonlan:
|
||||
mac: 00:00:5E:00:53:66
|
||||
port: 9
|
||||
delegate_to: localhost
|
||||
'''
|
||||
|
||||
|
|
Loading…
Reference in a new issue