From 7efec0302381a9464dd332cfc48827c9bff9321e Mon Sep 17 00:00:00 2001 From: shockrah Date: Sat, 11 Dec 2021 17:54:20 -0800 Subject: [PATCH] * Fixing issue with not running tasks with sudo + Creating users/groups for web admin operations --- playbooks/beta/init.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/playbooks/beta/init.yml b/playbooks/beta/init.yml index 9171ea8..becbf2f 100644 --- a/playbooks/beta/init.yml +++ b/playbooks/beta/init.yml @@ -1,10 +1,13 @@ +# This playbook goes through the process of setting up all the lower level +# infrastructure we need to start deploying website files to the server +# itself. --- - hosts: beta remote_user: ubuntu + become: yes + become_method: sudo tasks: - name: Install snapd package manager - become: yes - become_method: sudo apt: name: snapd update_cache: yes @@ -28,5 +31,24 @@ name: certbot classic: yes + - name: Create website admin group + group: + name: web + state: present + + - name: Create website user account + user: + name: web + comment: Website maintainer account + state: present + + - name: Create Web root directory under new web account + file: + path: /var/www + state: directory + recurse: yes + owner: web + group: web +