diff --git a/bootstrap.sh b/bootstrap.sh index 6983316a88da2b6e62bb1f5fda66b0fa202858c4..a96b9caef4b4b61eec9643e11ceb748b1a8012d1 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,7 +1,8 @@ #!/bin/bash ip link add link eno4 name eno4.151 type vlan id 151 ip addr add 10.151.43.202/16 dev eno4.151 +ip link set eno4 up ip link set eno4.151 up ip route add 0.0.0.0/0 via 10.151.255.254 apt update -apt install ansible python \ No newline at end of file +apt install ansible python diff --git a/install.yml b/install.yml index 5d7305170c5f268b1ed5171477accf6b47f35641..68818d51686e1a92ccc15708afd92bd799021a15 100644 --- a/install.yml +++ b/install.yml @@ -28,6 +28,7 @@ private: no - name: "bridge1_address" prompt: "Please provide bridge address for storage bond #1 in IP/Mask format:" + private: no - name: "bond2_name" prompt: "Please provide name for storage bond #2:" private: no @@ -39,9 +40,10 @@ private: no - name: "bridge2_address" prompt: "Please provide bridge address for storage bond #2 in IP/Mask format:" + private: no tasks: - set_fact: - c: "{{ interface_list_csv.split(',') }}" + interface_list: "{{ interface_list_csv.split(',') }}" - name: Upgrade import_tasks: tasks/upgrade.yml - name: Configure network diff --git a/tasks/create_users.yml b/tasks/create_users.yml index 2964cf6822c6bdf9a638545dd9aeb93b64af1536..09d915c4c3c8cf08a7d761e80d704b9e7469651b 100644 --- a/tasks/create_users.yml +++ b/tasks/create_users.yml @@ -8,6 +8,7 @@ with_items: - norbey - mike + - tgt - name: add key authorized_key: @@ -18,3 +19,7 @@ key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJJ6Rp2ETGHzEfyQZsR4Ac0iJUrtytLi2C7MZIiiCcug norbey@hellothere - name: mike key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBVHRlgZ+UTSBCChrpYTzOhLek9r9CcoNPoE2EcFXvz0 mike@curiosity + - name: tgt + key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB2Xg/WEJ1Tt4kO8fwbpvs+/w+UU5ZpENRaYfqmjdXjJ Takács Gergő Tibor (git.sch.bme.hu) + - name: root + key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJJ6Rp2ETGHzEfyQZsR4Ac0iJUrtytLi2C7MZIiiCcug norbey@hellothere diff --git a/tasks/net.yml b/tasks/net.yml index aebe7ccad4178f86ad9fa0a635fc9b2b04783500..305cde22dfe01e5191a6b0304910f75ec9e76ca8 100644 --- a/tasks/net.yml +++ b/tasks/net.yml @@ -7,13 +7,14 @@ state: present - name: Remove eno4.151 created by bootstrap script shell: - cmd: ip link del eno4.151 + cmd: ip link del eno4.151 || return 0 - name: Backup old interfaces file copy: src: /etc/network/interfaces dest: /etc/network/interfaces.old remote_src: yes + - name: Deploy new interfaces file template: src: templates/interfaces.j2 @@ -22,4 +23,4 @@ - name: Restart networking systemd: name: networking - state: restarted \ No newline at end of file + state: restarted diff --git a/templates/interfaces.j2 b/templates/interfaces.j2 index c199993b88a8d3ea796ad996a9b80311b382a353..33a53e899f1a0a1724feb119e85e7f5e72f0dd82 100644 --- a/templates/interfaces.j2 +++ b/templates/interfaces.j2 @@ -78,7 +78,7 @@ iface vmbr0 inet manual #Main bridge auto {{ bridge1_name }} -iface {{ bridge1_name }}{{ bridge1_name }} inet static +iface {{ bridge1_name }} inet static address {{ bridge1_address }} bridge-ports {{ bond1_name }} bridge-stp off