Playbook cleanup for html-deployer setup

This commit is contained in:
2024-09-29 18:05:27 -07:00
parent 16c0e5ee98
commit 3779d53810
2 changed files with 10 additions and 17 deletions

View File

@@ -1,18 +1,25 @@
---
- hosts: webhost
- name: Setup all attributes of the html-deployer user for static website CI
hosts: webhost
vars:
username: html-deployer
remote_user: webadmin
tasks:
- name: Create user for git actions to deploy html
become: true
user:
ansible.builtin.user:
name: "{{ username }}"
comment: Used for deploying html from Gitea Actions
group: nginx
- name: Set the authorized keys
become: true
authorized_key:
ansible.posix.authorized_key:
user: "{{ username }}"
state: present
key: "{{ lookup('file', '~/.ssh/vultr/html-deployer.pem.pub') }}"
- name: Ensure /opt/nginx website folders are owned by html-deployer
ansible.builtin.file:
path: "/opt/nginx/{{ item }}"
recurse: true
owner: "{{ username }}"
group: "nginx"