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"