From 63445f0a8314a77ad44ad0451769a5043bb79b1e Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Tue, 7 Jan 2025 15:55:20 +0800 Subject: [PATCH] Update setup script --- inventory/hosts | 9 +++++---- roles/tasks/debian/setup.yml | 10 ++++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/inventory/hosts b/inventory/hosts index 005a756..790c142 100644 --- a/inventory/hosts +++ b/inventory/hosts @@ -2,12 +2,13 @@ # Hyper-V Test Nodes # 172.22.90.75 ansible_ssh_common_args="-o StrictHostKeyChecking=no" # Bare Metal Nodes -10.0.10.4 ansible_ssh_common_args="-o StrictHostKeyChecking=no" -10.0.10.141 ansible_ssh_common_args="-o StrictHostKeyChecking=no" -10.0.10.64 ansible_ssh_common_args="-o StrictHostKeyChecking=no" +10.0.10.169 ansible_ssh_common_args="-o StrictHostKeyChecking=no" +# 10.0.10.4 ansible_ssh_common_args="-o StrictHostKeyChecking=no" +# 10.0.10.141 ansible_ssh_common_args="-o StrictHostKeyChecking=no" +# 10.0.10.64 ansible_ssh_common_args="-o StrictHostKeyChecking=no" [openwrt] -10.0.10.1 # Not enough storage space for these devices to support Ansible +# 10.0.10.1 # 10.0.10.2 # 10.0.10.3 \ No newline at end of file diff --git a/roles/tasks/debian/setup.yml b/roles/tasks/debian/setup.yml index e5c1039..e42b51a 100644 --- a/roles/tasks/debian/setup.yml +++ b/roles/tasks/debian/setup.yml @@ -4,12 +4,18 @@ become: true vars_files: "{{ playbook_dir | dirname | dirname | dirname }}/inventory/group_vars/debian.yml" tasks: + # Ensure SSH directory exists + - name: Ensure SSH directory exists + file: + path: ~/.ssh/ + state: directory + mode: "0700" - name: Add SSH key to authorized_hosts - Debian authorized_key: user: root state: present key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}" - path: /root/.ssh/authorized_keys + path: ~/.ssh/authorized_keys - name: Enable Root Login lineinfile: dest: /etc/ssh/sshd_config @@ -49,7 +55,7 @@ - socat - fish - iperf3 - - resolvconf + - dnsmasq # Cache is already updated from previous step update_cache: false autoremove: true