Chages in playbook to connect as a root user.
This commit is contained in:
@@ -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:
|
||||
|
||||
3
vars.yml
3
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"
|
||||
|
||||
Reference in New Issue
Block a user