From a970d344e91c64897f8345b3582c38c04aae135c Mon Sep 17 00:00:00 2001 From: shockrah Date: Fri, 21 Oct 2022 20:55:52 -0700 Subject: [PATCH] - No longer using web user to copy static content + init.yml now creates web user properly --- .gitignore | 1 + playbooks/beta/files/.gitkeep | 0 playbooks/beta/init.yml | 16 ++++++++++++++-- playbooks/beta/websites/update-blog.yml | 4 ++-- playbooks/beta/websites/update-fc-docs.yml | 4 ++-- playbooks/beta/websites/update-qrcodes.yml | 6 +++--- playbooks/beta/websites/update-resume.yml | 4 ++-- 7 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 playbooks/beta/files/.gitkeep diff --git a/.gitignore b/.gitignore index f6393f4..9598cdc 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ playbooks/.env/ playbooks/alpha/searx/settings.yml playbooks/beta/vars/*.yml playbooks/env/ +playbooks/beta/files/*.pub diff --git a/playbooks/beta/files/.gitkeep b/playbooks/beta/files/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/beta/init.yml b/playbooks/beta/init.yml index becbf2f..105e9ed 100644 --- a/playbooks/beta/init.yml +++ b/playbooks/beta/init.yml @@ -14,8 +14,6 @@ state: present - name: Install Nginx - become: yes - become_method: sudo apt: name: nginx update_cache: yes @@ -42,6 +40,20 @@ comment: Website maintainer account state: present + - name: Create /home/web/.ssh directory + file: + path: /home/web/.ssh + state: directory + owner: web + group: web + mode: 0700 + + - name: Copy public web key to beta + authorized_key: + user: web + key: "{{ lookup('file', 'files/'+'web.pub') }}" + + - name: Create Web root directory under new web account file: path: /var/www diff --git a/playbooks/beta/websites/update-blog.yml b/playbooks/beta/websites/update-blog.yml index e2198a5..efba250 100644 --- a/playbooks/beta/websites/update-blog.yml +++ b/playbooks/beta/websites/update-blog.yml @@ -1,6 +1,6 @@ --- -- hosts: web - remote_user: web +- hosts: beta + become: yes tasks: - name: Push blog content copy: diff --git a/playbooks/beta/websites/update-fc-docs.yml b/playbooks/beta/websites/update-fc-docs.yml index a83c486..75cf048 100644 --- a/playbooks/beta/websites/update-fc-docs.yml +++ b/playbooks/beta/websites/update-fc-docs.yml @@ -1,6 +1,6 @@ --- -- hosts: web - remote_user: web +- hosts: beta + become: yes tasks: - name: Push docs content copy: diff --git a/playbooks/beta/websites/update-qrcodes.yml b/playbooks/beta/websites/update-qrcodes.yml index b022dc8..115dd80 100644 --- a/playbooks/beta/websites/update-qrcodes.yml +++ b/playbooks/beta/websites/update-qrcodes.yml @@ -1,6 +1,6 @@ --- -- hosts: web - remote_user: web +- hosts: beta + become: yes tasks: - name: Fetch variables from role specific vars file include_vars: @@ -9,4 +9,4 @@ copy: src: "{{QRCODES_LOCAL_PUBLIC}}/public/" dest: /var/www/qrcodes.leftcoast.space - \ No newline at end of file + diff --git a/playbooks/beta/websites/update-resume.yml b/playbooks/beta/websites/update-resume.yml index a836918..da3730f 100644 --- a/playbooks/beta/websites/update-resume.yml +++ b/playbooks/beta/websites/update-resume.yml @@ -1,6 +1,6 @@ --- -- hosts: web - remote_user: web +- hosts: beta + become: yes tasks: - name: Fetch variables from role specific vars file include_vars: