Playbook cleanup for html-deployer setup
Some checks failed
Actions demo / simple-echo (push) Waiting to run
Secops Linting and Safety Checks / checkov-scan-s3 (push) Failing after 44s

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

View File

@ -1,14 +0,0 @@
---
- hosts: webhost
remote_user: root
tasks:
- name: Copy pull script
copy:
src: ../scripts/pull-down-s3.sh
dest: /opt/nginx/pull-down-s3.sh
- name: Pull down all sites from S3
shell: bash /opt/nginx/pull-down-s3.sh {{ item }}
loop:
- shockrah.xyz
- resume.shockrah.xyz
- temper.tv

View File

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