Files
ansible-repo/playbooks/users.yml
hogweed1 bee9fe3c03
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1s
make ssh-certs for hogweed1 again.
2026-06-21 02:05:06 +10:00

35 lines
1.1 KiB
YAML

---
- name: users
hosts: all
become: yes
tasks:
- name: make-me
ansible.builtin.user:
name: hogweed1
shell: /bin/bash
create_home: yes
# python -c 'import crypt; print crypt.crypt("This is my Password", "$1$SomeSalt$")'
password: $6$KHOI$0Dq28VBwgtNFvfbQQ.4s6koctN6e5ZWRRBhWp0lkKKiel8y2qhc89E0CY479b4EX5.CnfDhS8rlaOATk/rXLu0
- name: Set authorized key taken from file
ansible.posix.authorized_key:
user: hogweed1
state: present
key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINHTnXy693g6ivEJ6D5VrTBnjEjIe/a00cU7/9Hb79Zf hogweed1@vdk2ch.ru"
- name: Make users passwordless for sudo in group wheel
lineinfile:
path: /etc/sudoers
state: present
regexp: '^%hogweed1'
line: '%hogweed1 ALL=(ALL) NOPASSWD: ALL'
validate: 'visudo -cf %s'
- name: auth_principals чтобы пускало по сертификату
copy:
dest: "/etc/ssh/auth_principals/hogweed1"
content: "pmc-314\n"
owner: root
group: root
mode: '0644'