From 7f9ed3662adf28caaa16f8a45969e47a7cd3a5fa Mon Sep 17 00:00:00 2001 From: Pureewat Kaewpoi Date: Tue, 3 Oct 2023 15:26:30 +0700 Subject: [PATCH 1/4] Replace "." with "/" for sysctl --- tasks/sysctl.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/sysctl.yml b/tasks/sysctl.yml index cf418b33..46425cf9 100644 --- a/tasks/sysctl.yml +++ b/tasks/sysctl.yml @@ -14,7 +14,7 @@ - name: Set sysctl net.ipv6.conf.accept_ra_rtr_pref become: true ansible.posix.sysctl: - name: net.ipv6.conf.{{ ansible_default_ipv4.interface }}.accept_ra_rtr_pref + name: net.ipv6.conf.{{ ansible_default_ipv4.interface | regex_replace('\.', '/') }}.accept_ra_rtr_pref value: "{{ sysctl_net_ipv6_conf_accept_ra_rtr_pref | int }}" state: present sysctl_set: true From c0d9a6cdec4ef1fb6d6536ba060e53e21af4e1c4 Mon Sep 17 00:00:00 2001 From: Pureewat Kaewpoi Date: Tue, 19 Dec 2023 15:05:12 +0700 Subject: [PATCH 2/4] quoted and add escape string for backslash --- tasks/sysctl.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/sysctl.yml b/tasks/sysctl.yml index 46425cf9..811acbf1 100644 --- a/tasks/sysctl.yml +++ b/tasks/sysctl.yml @@ -14,7 +14,7 @@ - name: Set sysctl net.ipv6.conf.accept_ra_rtr_pref become: true ansible.posix.sysctl: - name: net.ipv6.conf.{{ ansible_default_ipv4.interface | regex_replace('\.', '/') }}.accept_ra_rtr_pref + name: "net.ipv6.conf.{{ ansible_default_ipv4.interface | regex_replace('\\.', '/') }}.accept_ra_rtr_pref" value: "{{ sysctl_net_ipv6_conf_accept_ra_rtr_pref | int }}" state: present sysctl_set: true From 14d48eeb12aaca93e730fb4529ef995a36904821 Mon Sep 17 00:00:00 2001 From: Pureewat Kaewpoi Date: Tue, 19 Dec 2023 15:05:33 +0700 Subject: [PATCH 3/4] add test vm for vlan devices --- Vagrantfile | 27 ++++++++++++++++++++++++++- molecule/debian/molecule.yml | 11 +++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 98ed6aa6..567b2c7b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,7 +2,32 @@ Vagrant.configure("2") do |config| config.vbguest.installer_options = { allow_kernel_upgrade: true } config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"] - vb.customize ["modifyvm", :id, "--uartmode1", "file", File::NULL] + vb.customize ["modifyvm", :id, "--uartmode1", "disconnected"] + end + + config.vm.define "bullseye_vlan" do |bullseye_vlan| + bullseye_vlan.vm.box = "debian/bullseye64" + bullseye_vlan.ssh.insert_key = true + bullseye_vlan.vm.hostname = "bullseye-vlan" + bullseye_vlan.vm.boot_timeout = 600 + bullseye_vlan.vbguest.auto_update = false + bullseye_vlan.vm.provision "shell", + inline: "ip link set dev eth0 down; ip link set eth0 name eth0.101; ip link set dev eth0.101 up; dhclient -r eth0.101; dhclient eth0.101" + bullseye_vlan.vm.provision "shell", + inline: "apt-get update && apt-get -y install python3-pip && pip3 install ansible" + bullseye_vlan.vm.provision "ansible" do |a| + a.verbose = "v" + a.limit = "all" + a.playbook = "tests/test.yml" + a.extra_vars = { + "ansible_become_pass" => "vagrant", + "ansible_python_interpreter" => "/usr/bin/python3", + "sshd_admin_net" => "0.0.0.0/0", + "sshd_allow_groups" => "vagrant sudo debian ubuntu", + "system_upgrade" => "no", + "install_aide" => "false" + } + end end config.vm.define "bullseye" do |bullseye| diff --git a/molecule/debian/molecule.yml b/molecule/debian/molecule.yml index b1fe46c7..c404a107 100644 --- a/molecule/debian/molecule.yml +++ b/molecule/debian/molecule.yml @@ -17,6 +17,12 @@ provisioner: log: true inventory: host_vars: + bullseye_vlan: + ansible_python_interpreter: /usr/bin/python3 + sshd_admin_net: "0.0.0.0/0" + sshd_allow_groups: vagrant sudo + suid_sgid_permissions: false + system_upgrade: false bookworm: ansible_python_interpreter: /usr/bin/python3 sshd_admin_net: "0.0.0.0/0" @@ -41,6 +47,11 @@ platforms: instance_raw_config_args: - "vbguest.installer_options = { allow_kernel_upgrade: true }" memory: 1024 + - name: bullseye_vlan + box: debian/bullseye64 + instance_raw_config_args: + - vbguest.auto_update = false + memory: 1024 - name: bullseye box: debian/bullseye64 instance_raw_config_args: From 4200db37321c9f06ea485b824df08a7d1ca57a2a Mon Sep 17 00:00:00 2001 From: Pureewat Kaewpoi Date: Thu, 21 Dec 2023 11:30:18 +0700 Subject: [PATCH 4/4] fix Vagrantfile syntax --- Vagrantfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index eb900cd4..7c5c24b5 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -22,10 +22,10 @@ Vagrant.configure("2") do |config| a.extra_vars = { "ansible_become_pass" => "vagrant", "ansible_python_interpreter" => "/usr/bin/python3", - "sshd_admin_net" => "0.0.0.0/0", - "sshd_allow_groups" => "vagrant sudo debian ubuntu", - "system_upgrade" => "no", - "install_aide" => "false" + "sshd_admin_net" => ["0.0.0.0/0"], + "sshd_allow_groups" => ["vagrant", "sudo", "debian", "ubuntu"], + "system_upgrade" => "false", + "install_aide" => "false", } end end @@ -47,7 +47,7 @@ Vagrant.configure("2") do |config| "ansible_python_interpreter" => "/usr/bin/python3", "sshd_admin_net" => ["0.0.0.0/0"], "sshd_allow_groups" => ["vagrant", "sudo", "debian", "ubuntu"], - "system_upgrade" => "no", + "system_upgrade" => "false", } end end