diff --git a/host-rousseau.yml b/host-rousseau.yml deleted file mode 100644 index 58b7c45..0000000 --- a/host-rousseau.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- hosts: rousseau.n39.eu - become: true - - vars: - ansible_python_interpreter: /usr/bin/python3 - - roles: - - tasks: - - - name: debug - ansible.builtin.debug: - msg: hello rousseau - - handlers: diff --git a/host-vyos.yml b/host-vyos.yml new file mode 100644 index 0000000..4b0cf86 --- /dev/null +++ b/host-vyos.yml @@ -0,0 +1,61 @@ +--- +- hosts: vyos.n39.eu + become: true + + vars: + ansible_python_interpreter: /usr/bin/python3 + + roles: + + tasks: + - name: Replace provided configuration with device configuration + vyos.vyos.vyos_interfaces: + config: + - name: eth0 + description: VLAN04 - Client Netz + - name: eth1 + description: VLAN07 - Telekom Modem + - name: eth2 + description: VLAN09 - DMZ + - name: eth3 + description: VLAN71 - Telekom Status + - name: eth4 + description: VLAN100 - RAW Internet + state: replaced + + - name: Merge provided configuration with device configuration + vyos.vyos.vyos_l3_interfaces: + config: + - name: eth0 + ipv4: + - address: 172.23.48.2/22 + - name: eth2 + ipv4: + - address: 172.23.52.2/22 + - name: eth3 + ipv4: + - address: 192.168.100.3/24 + - name: eth4 + ipv4: + - address: 192.168.39.1/24 + + - name: Configure a DHCP Server + vyos.vyos.vyos_config: + lines: + - set service dhcp-server disabled 'false' + - set service dhcp-server shared-network-name Client subnet 172.23.48.0/22 default-router '172.23.48.2' start '172.23.48.150' stop '172.23.51.250' + - set service dhcp-server shared-network-name Client subnet 172.23.52.0/22 default-router '172.23.52.2' start '172.23.53.0' stop '172.23.53.255' + - set service dhcp-server shared-network-name Client subnet 192.168.39.0/24 default-router '192.168.39.1' + save: yes + + - name: And a DNS forwarder + vyos.vyos.vyos_config: + lines: + - set system static-host-mapping host-name + save: yes + + handlers: + - name: restart + vyos.vyos.command: + commands: + - restart diff --git a/host_vars/rousseau.n39.eu/vars.yml b/host_vars/rousseau.n39.eu/vars.yml deleted file mode 100644 index 86f0609..0000000 --- a/host_vars/rousseau.n39.eu/vars.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -vyos_user: "vyos" -vyos_password: "${{ vault_vyos_password }}" \ No newline at end of file diff --git a/host_vars/vyos.n39.eu/vars.yml b/host_vars/vyos.n39.eu/vars.yml new file mode 100644 index 0000000..8a89c21 --- /dev/null +++ b/host_vars/vyos.n39.eu/vars.yml @@ -0,0 +1,6 @@ +--- +ansible_user: vyos +ansible_connection: ansible.netcommon.network_cli +ansible_network_os: vyos +vyos_user: "vyos" +vyos_password: "${{ vault_vyos_password }}" \ No newline at end of file diff --git a/host_vars/rousseau.n39.eu/vault b/host_vars/vyos.n39.eu/vault similarity index 100% rename from host_vars/rousseau.n39.eu/vault rename to host_vars/vyos.n39.eu/vault diff --git a/inventory.yml b/inventory.yml index b1513b4..340e3e1 100644 --- a/inventory.yml +++ b/inventory.yml @@ -18,6 +18,7 @@ all: k3s-w1.n39.eu: k3s-w2.n39.eu: k3s-w3.n39.eu: + # vyos.n39.eu: children: docker_host: @@ -61,6 +62,7 @@ all: k3s-w1.n39.eu: k3s-w2.n39.eu: k3s-w3.n39.eu: + rousseau.n39.eu: location_internet: hosts: tau.netz39.de: