deployment user
This commit is contained in:
16
create_deployment_user.yml
Normal file
16
create_deployment_user.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
- name: Create required deployment users
|
||||
hosts: all
|
||||
become: yes # Run tasks with root/sudo privileges
|
||||
|
||||
tasks:
|
||||
- name: Create Ansible user
|
||||
user:
|
||||
name: ansible # Username
|
||||
groups: sudo
|
||||
expires: -1
|
||||
password: "{{ 'mypassword' | password_hash('sha512') }}" # Encrypted password
|
||||
state: present # Ensure the user is present
|
||||
createhome: yes # Create the user's home directory
|
||||
generate_ssh_key: yes # Generate an SSH key pair for the user
|
||||
ssh_key_bits: 2048
|
||||
ssh_key_file: .ssh/id_rsa
|
8
homelab.code-workspace
Normal file
8
homelab.code-workspace
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
}
|
Reference in New Issue
Block a user