infra-ansible

ansible script to ship alpine/ssh/wireguard

git clone https://9o.is/git/infra-ansible.git

commit 524a33df52829afec92bf60dd975bb78042c1560
parent 7e290e3d3adea45b3456f9a7317e256b3e646086
Author: Jul <jul@9o.is>
Date:   Mon, 13 May 2024 16:52:03 +0800

set mtu idempotently

Diffstat:
Mhost/roles/setup/tasks/main.yml | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/host/roles/setup/tasks/main.yml b/host/roles/setup/tasks/main.yml @@ -3,7 +3,12 @@ raw: | apt install -y iproute2 ip link set {{ net_interface }} mtu 576 - echo "mtu 576" >> /etc/network/interfaces + + if grep 'mtu' /etc/network/interfaces; then + sed -i 's/mtu.*/mtu 576/' /etc/network/interfaces + else + echo "mtu 576" >> /etc/network/interfaces + fi - name: Install Python raw: apt install -y python3