From 04becbb99db31b167d0a03f2e8392b265de284cc Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Thu, 8 Jun 2023 20:37:52 +0200 Subject: [PATCH] put lewis in DMZ network --- ansible/{dmz.conf => dmz.conf.j2} | 5 +++++ ansible/hypervisors.yml | 10 +++++----- ansible/inventory/host_vars/atlas/main.yml | 2 ++ ansible/inventory/host_vars/jefke/main.yml | 2 ++ ansible/inventory/host_vars/lewis/main.yml | 3 +++ 5 files changed, 17 insertions(+), 5 deletions(-) rename ansible/{dmz.conf => dmz.conf.j2} (75%) create mode 100644 ansible/inventory/host_vars/atlas/main.yml create mode 100644 ansible/inventory/host_vars/jefke/main.yml create mode 100644 ansible/inventory/host_vars/lewis/main.yml diff --git a/ansible/dmz.conf b/ansible/dmz.conf.j2 similarity index 75% rename from ansible/dmz.conf rename to ansible/dmz.conf.j2 index aa141b5..be94440 100644 --- a/ansible/dmz.conf +++ b/ansible/dmz.conf.j2 @@ -1,5 +1,10 @@ auto enp3s0.30 +{% if dmz_interface.enabled %} +iface enp3s0.30 inet dhcp + hwaddress ether {{ dmz_interface.mac }} +{% else %} iface enp3s0.30 inet manual +{% endif %} iface enp3s0.30 inet6 auto accept_ra 0 dhcp 0 diff --git a/ansible/hypervisors.yml b/ansible/hypervisors.yml index c29dfa0..4746b3b 100644 --- a/ansible/hypervisors.yml +++ b/ansible/hypervisors.yml @@ -32,8 +32,8 @@ pre_tasks: - name: Copy interfaces configuration - copy: - src: dmz.conf + template: + src: dmz.conf.j2 dest: /etc/network/interfaces.d/dmz.conf register: interfaces @@ -53,6 +53,6 @@ - {role: ssh_ca_known_hosts, tags: ssh_ca_known_hosts} - {role: deploy_ssh_certificates, tags: deploy_ssh_certificates} -- hosts: atlas, jefke - roles: - - {role: borg, tags: borg} +# - hosts: atlas, jefke +# roles: +# - {role: borg, tags: borg} diff --git a/ansible/inventory/host_vars/atlas/main.yml b/ansible/inventory/host_vars/atlas/main.yml new file mode 100644 index 0000000..77d1db9 --- /dev/null +++ b/ansible/inventory/host_vars/atlas/main.yml @@ -0,0 +1,2 @@ +dmz_interface: + enabled: false diff --git a/ansible/inventory/host_vars/jefke/main.yml b/ansible/inventory/host_vars/jefke/main.yml new file mode 100644 index 0000000..77d1db9 --- /dev/null +++ b/ansible/inventory/host_vars/jefke/main.yml @@ -0,0 +1,2 @@ +dmz_interface: + enabled: false diff --git a/ansible/inventory/host_vars/lewis/main.yml b/ansible/inventory/host_vars/lewis/main.yml new file mode 100644 index 0000000..09199a6 --- /dev/null +++ b/ansible/inventory/host_vars/lewis/main.yml @@ -0,0 +1,3 @@ +dmz_interface: + enabled: true + mac: "ca:fe:c0:ff:ee:0b"