mirror of
https://github.com/linux-system-roles/network.git
synced 2026-07-28 13:33:57 +00:00
examples: add example playbooks
This commit is contained in:
parent
c4bd00d1b4
commit
05f49d7922
5 changed files with 84 additions and 0 deletions
35
examples/bridge-with-vlan.yml
Normal file
35
examples/bridge-with-vlan.yml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
- hosts: network-test
|
||||
vars:
|
||||
network_connections:
|
||||
|
||||
# Create a bridge profile, which is the parent of VLAN.
|
||||
- name: prod2
|
||||
state: up
|
||||
type: bridge
|
||||
interface_name: bridge2
|
||||
ip:
|
||||
dhcp4: no
|
||||
auto6: no
|
||||
|
||||
# enslave an ethernet to the bridge
|
||||
- name: prod2-slave1
|
||||
state: up
|
||||
type: ethernet
|
||||
interface_name: "{{ network_interface_name2 }}"
|
||||
master: prod2
|
||||
slave_type: bridge
|
||||
|
||||
# on top of it, create a VLAN with ID 100 and static
|
||||
# addressing
|
||||
- name: prod2.100
|
||||
state: up
|
||||
type: vlan
|
||||
parent: prod2
|
||||
vlan_id: 100
|
||||
ip:
|
||||
address:
|
||||
- "192.168.174.{{ network_iphost }}/24"
|
||||
|
||||
roles:
|
||||
- network
|
||||
17
examples/eth-simple-auto.yml
Normal file
17
examples/eth-simple-auto.yml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
- hosts: network-test
|
||||
vars:
|
||||
network_connections:
|
||||
|
||||
# Create one ethernet profile and activate it.
|
||||
# The profile uses automatic IP addressing
|
||||
# and is tied to the interface by MAC address.
|
||||
- name: prod1
|
||||
state: up
|
||||
type: ethernet
|
||||
autoconnect: yes
|
||||
mac: "{{ network_mac1 }}"
|
||||
mtu: 1450
|
||||
|
||||
roles:
|
||||
- network
|
||||
27
examples/eth-with-vlan.yml
Normal file
27
examples/eth-with-vlan.yml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
- hosts: network-test
|
||||
vars:
|
||||
network_connections:
|
||||
|
||||
# Create a profile for the underlying device of the VLAN.
|
||||
- name: prod2
|
||||
type: ethernet
|
||||
autoconnect: no
|
||||
interface_name: "{{ network_interface_name2 }}"
|
||||
ip:
|
||||
dhcp4: no
|
||||
auto6: no
|
||||
|
||||
# on top of it, create a VLAN with ID 100 and static
|
||||
# addressing
|
||||
- name: prod2.100
|
||||
state: up
|
||||
type: vlan
|
||||
parent: prod2
|
||||
vlan_id: 100
|
||||
ip:
|
||||
address:
|
||||
- "192.168.174.{{ network_iphost }}/24"
|
||||
|
||||
roles:
|
||||
- network
|
||||
4
examples/inventory
Normal file
4
examples/inventory
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# an inventory for the examples.
|
||||
[network-test]
|
||||
v-rhel6 ansible_user=root network_iphost=196 network_mac1=52:54:00:44:9f:ba network_interface_name1=eth0 network_interface_name2=eth1
|
||||
v-rhel7 ansible_user=root network_iphost=97 network_mac1=52:54:00:05:f5:b3 network_interface_name1=eth0 network_interface_name2=eth1
|
||||
1
examples/roles/network
Symbolic link
1
examples/roles/network
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../..
|
||||
Loading…
Add table
Add a link
Reference in a new issue