x
This commit is contained in:
+41
-38
@@ -221,50 +221,53 @@
|
|||||||
|
|
||||||
#### User: first
|
#### User: first
|
||||||
|
|
||||||
# - name: Create the first user
|
- name: Create the first user
|
||||||
# become: true
|
become: true
|
||||||
# ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
# name: first
|
name: first
|
||||||
# comment: First User
|
comment: First User
|
||||||
# state: present
|
state: present
|
||||||
# system: false
|
system: false
|
||||||
# create_home: true
|
groups: hpf-sudo-np
|
||||||
# shell: /usr/bin/bash
|
append: true
|
||||||
|
create_home: true
|
||||||
|
shell: /usr/bin/bash
|
||||||
|
uid_max: 1000
|
||||||
|
|
||||||
# - name: Set first's authorized_keys
|
- name: Set first's authorized_keys
|
||||||
# become: true
|
become: true
|
||||||
# ansible.posix.authorized_key:
|
ansible.posix.authorized_key:
|
||||||
# user: first
|
user: first
|
||||||
# state: present
|
state: present
|
||||||
# key: "{{ lookup('file', item) }}"
|
key: "{{ lookup('file', item) }}"
|
||||||
# loop:
|
loop:
|
||||||
# - files/ssh-keys/first.pub
|
- files/ssh-keys/first.pub
|
||||||
# - files/ssh-keys/heath.pub
|
- files/ssh-keys/heath.pub
|
||||||
|
|
||||||
|
|
||||||
#### User: heath
|
#### User: heath
|
||||||
|
|
||||||
# - name: Create the heath group
|
- name: Create the heath group
|
||||||
# become: true
|
become: true
|
||||||
# ansible.builtin.group:
|
ansible.builtin.group:
|
||||||
# name: heath
|
name: heath
|
||||||
# state: present
|
state: present
|
||||||
# system: false
|
system: false
|
||||||
# gid: 8000
|
gid: 60001
|
||||||
|
|
||||||
# - name: Create the heath user
|
- name: Create the heath user
|
||||||
# become: true
|
become: true
|
||||||
# ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
# name: heath
|
name: heath
|
||||||
# comment: Heath Petersen
|
comment: Heath Petersen
|
||||||
# state: present
|
state: present
|
||||||
# system: false
|
system: false
|
||||||
# uid: 8000
|
uid: 60001
|
||||||
# group: heath
|
group: heath
|
||||||
# groups: hpf-sudo
|
groups: hpf-sudo
|
||||||
# append: true
|
append: true
|
||||||
# create_home: true
|
create_home: true
|
||||||
# shell: /usr/bin/bash
|
shell: /usr/bin/bash
|
||||||
|
|
||||||
- name: Set heath's authorized_keys
|
- name: Set heath's authorized_keys
|
||||||
become: true
|
become: true
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user