diff --git a/examples/bridge-with-vlan.yml b/examples/bridge-with-vlan.yml new file mode 100644 index 0000000..ce48443 --- /dev/null +++ b/examples/bridge-with-vlan.yml @@ -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 diff --git a/examples/eth-simple-auto.yml b/examples/eth-simple-auto.yml new file mode 100644 index 0000000..5934ca8 --- /dev/null +++ b/examples/eth-simple-auto.yml @@ -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 diff --git a/examples/eth-with-vlan.yml b/examples/eth-with-vlan.yml new file mode 100644 index 0000000..d269886 --- /dev/null +++ b/examples/eth-with-vlan.yml @@ -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 diff --git a/examples/inventory b/examples/inventory new file mode 100644 index 0000000..645fdf6 --- /dev/null +++ b/examples/inventory @@ -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 diff --git a/examples/roles/network b/examples/roles/network new file mode 120000 index 0000000..c25bddb --- /dev/null +++ b/examples/roles/network @@ -0,0 +1 @@ +../.. \ No newline at end of file