nginx_logsync: Rename logsync user to weblog

This commit is contained in:
Timo Makinen 2025-05-16 16:45:11 +00:00
parent 61eade7662
commit de5a72dc8d

View file

@ -1,34 +1,34 @@
---
- name: Create group
ansible.builtin.group:
name: logsync
name: weblog
system: true
- name: Create user
ansible.builtin.user:
name: logsync
comment: Service logsync
name: weblog
comment: Service weblog
create_home: false
group: logsync
group: weblog
home: /var/empty
shell: /sbin/nologin
- name: Create authorized_keys
ansible.builtin.copy:
dest: /etc/ssh/authorized_keys.logsync
src: ../files/ssh/logsync.pub
dest: /etc/ssh/authorized_keys.weblog
src: ../files/ssh/weblog.pub
mode: "0640"
owner: root
group: logsync
group: weblog
- name: Configure sshd chroot
ansible.builtin.blockinfile:
path: /etc/ssh/sshd_config
block: |
Match User logsync
Match User weblog
ChrootDirectory /var/www/logs
ForceCommand internal-sftp
AuthorizedKeysFile /etc/ssh/authorized_keys.logsync
marker: "# {mark} ANSIBLE MANAGED BLOCK (user logsync)"
AuthorizedKeysFile /etc/ssh/authorized_keys.weblog
marker: "# {mark} ANSIBLE MANAGED BLOCK (user weblog)"
validate: "sshd -t -f %s"
notify: Restart sshd