This commit is contained in:
2026-07-25 16:58:57 -05:00
parent bcd45cff9e
commit 4f86f4c114
2 changed files with 56 additions and 38 deletions
+41 -38
View File
@@ -221,50 +221,53 @@
#### User: first
# - name: Create the first user
# become: true
# ansible.builtin.user:
# name: first
# comment: First User
# state: present
# system: false
# create_home: true
# shell: /usr/bin/bash
- name: Create the first user
become: true
ansible.builtin.user:
name: first
comment: First User
state: present
system: false
groups: hpf-sudo-np
append: true
create_home: true
shell: /usr/bin/bash
uid_max: 1000
# - name: Set first's authorized_keys
# become: true
# ansible.posix.authorized_key:
# user: first
# state: present
# key: "{{ lookup('file', item) }}"
# loop:
# - files/ssh-keys/first.pub
# - files/ssh-keys/heath.pub
- name: Set first's authorized_keys
become: true
ansible.posix.authorized_key:
user: first
state: present
key: "{{ lookup('file', item) }}"
loop:
- files/ssh-keys/first.pub
- files/ssh-keys/heath.pub
#### User: heath
# - name: Create the heath group
# become: true
# ansible.builtin.group:
# name: heath
# state: present
# system: false
# gid: 8000
- name: Create the heath group
become: true
ansible.builtin.group:
name: heath
state: present
system: false
gid: 60001
# - name: Create the heath user
# become: true
# ansible.builtin.user:
# name: heath
# comment: Heath Petersen
# state: present
# system: false
# uid: 8000
# group: heath
# groups: hpf-sudo
# append: true
# create_home: true
# shell: /usr/bin/bash
- name: Create the heath user
become: true
ansible.builtin.user:
name: heath
comment: Heath Petersen
state: present
system: false
uid: 60001
group: heath
groups: hpf-sudo
append: true
create_home: true
shell: /usr/bin/bash
- name: Set heath's authorized_keys
become: true
+15
View File
@@ -0,0 +1,15 @@
---
- name: Create user
hosts: all
tasks:
- name: Create the second user
become: true
ansible.builtin.user:
name: second
comment: Second User
state: present
system: false
create_home: true
shell: /usr/bin/bash