ADD: AddUser-josef.yaml

This commit is contained in:
root 2025-05-26 11:31:47 +07:00
parent 37d8c735c1
commit c827241551
2 changed files with 27 additions and 1 deletions

View File

@ -1,4 +1,9 @@
[gluster]
s00-gl01 ansible_host=192.168.0.21
s00-gl02 ansible_host=192.168.0.22
s00-gl03 ansible_host=192.168.0.23
s00-gl03 ansible_host=192.168.0.23
[linux]
s00-mn01 ansible_host=192.168.0.10
s00-mx01 ansible_host=192.168.0.20
s00-px01 ansible_host=192.168.0.15

View File

@ -0,0 +1,21 @@
---
- name: "ADD NEW USER: josef"
hosts: all
become: true
vars:
login: "josef"
pubkey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIiQpYsV2PtDi3GVrXcjn/LZYPypgmqucNAz+QMnnBoh josef@josef-X99"
shell: "/bin/bash"
tasks:
- name: "ADD USER"
ansible.builtin.user:
name: "{{ login }}"
comment: "{{ login }}"
state: present
shell: "{{ shell }}"
create_home: true
- name: "ADD KEY"
ansible.posix.authorized_key:
user: "{{ login }}"
key: "{{ pubkey }}"
state: present