From cb734c9b18d28864bd65416b7dee6967df131675 Mon Sep 17 00:00:00 2001 From: Maksym Buz Date: Sun, 24 Aug 2025 14:52:14 +0200 Subject: [PATCH] Chages in playbook to connect as a root user. --- playbooks/lxc_setup_ubuntu.yml | 2 +- vars.yml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/playbooks/lxc_setup_ubuntu.yml b/playbooks/lxc_setup_ubuntu.yml index 379fc7c..5725cfa 100644 --- a/playbooks/lxc_setup_ubuntu.yml +++ b/playbooks/lxc_setup_ubuntu.yml @@ -1,7 +1,7 @@ --- - name: Secure and Configure a New LXC Container hosts: 'lxc' # Hosts or group defined in your inventory - become: yes # Run all tasks as root (sudo) + remote_user: root tasks: - name: 1. Create user '{{ target_user }}' ansible.builtin.user: diff --git a/vars.yml b/vars.yml index 03955ce..4021296 100644 --- a/vars.yml +++ b/vars.yml @@ -1,9 +1,6 @@ # User which will be created on the LXC containers to replace root target_user: 'mbuz' -# User which Ansible will use to connect to the LXC containers initially -ansible_user: 'root' - # List of public keys to be added to the target_user's authorized_keys file my_public_keys: - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINSGj0dxaA38QSBVY3DZiPb+qmIuTFxGo0mt4sbmYDa3 mbuz@macbook-pro"