From 3779d538109411233009162c0d73bf2020bd6a17 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 29 Sep 2024 18:05:27 -0700 Subject: [PATCH] Playbook cleanup for html-deployer setup --- ansible/playbooks/pull-s3-buckets.yml | 14 -------------- ansible/playbooks/setup-git-web-deployer.yml | 13 ++++++++++--- 2 files changed, 10 insertions(+), 17 deletions(-) delete mode 100644 ansible/playbooks/pull-s3-buckets.yml diff --git a/ansible/playbooks/pull-s3-buckets.yml b/ansible/playbooks/pull-s3-buckets.yml deleted file mode 100644 index 61a7016..0000000 --- a/ansible/playbooks/pull-s3-buckets.yml +++ /dev/null @@ -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 diff --git a/ansible/playbooks/setup-git-web-deployer.yml b/ansible/playbooks/setup-git-web-deployer.yml index 6ecc874..f7e0296 100644 --- a/ansible/playbooks/setup-git-web-deployer.yml +++ b/ansible/playbooks/setup-git-web-deployer.yml @@ -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"