Playbook cleanup for html-deployer setup
This commit is contained in:
parent
16c0e5ee98
commit
3779d53810
@ -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
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user