67 lines
1.4 KiB
YAML
67 lines
1.4 KiB
YAML
# 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
|
|
apt:
|
|
name: snapd
|
|
update_cache: yes
|
|
state: present
|
|
|
|
- name: Install Nginx
|
|
apt:
|
|
name: nginx
|
|
update_cache: yes
|
|
state: present
|
|
|
|
- name: Update Snap
|
|
community.general.snap:
|
|
name: core
|
|
state: present
|
|
|
|
- name: Install Certbot Snap Package
|
|
community.general.snap:
|
|
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 /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
|
|
state: directory
|
|
recurse: yes
|
|
owner: web
|
|
group: web
|
|
|
|
|
|
|