2021-11-02 14:45:05 -07:00
|
|
|
---
|
2021-11-02 16:29:52 -07:00
|
|
|
- name: Set up the environment for the impress-2020 app
|
2021-11-02 16:01:30 -07:00
|
|
|
hosts: webserver
|
2021-11-02 14:45:05 -07:00
|
|
|
tasks:
|
2021-11-02 16:01:30 -07:00
|
|
|
- name: Create web user group
|
|
|
|
become: yes
|
|
|
|
group:
|
|
|
|
name: web
|
2021-11-02 18:47:13 -07:00
|
|
|
|
2021-11-02 16:01:30 -07:00
|
|
|
- name: Add current user to web group
|
|
|
|
become: yes
|
|
|
|
user:
|
|
|
|
name: "{{ ansible_user_id }}"
|
|
|
|
group: web
|
|
|
|
append: yes
|
2021-11-02 18:47:13 -07:00
|
|
|
|
2021-11-02 16:01:30 -07:00
|
|
|
- name: Create the app folder
|
|
|
|
become: yes
|
|
|
|
file:
|
|
|
|
path: /srv/impress-2020
|
|
|
|
state: directory
|
|
|
|
# Root and the `web` group may read/write this folder. Everyone else
|
|
|
|
# may only read it.
|
|
|
|
group: web
|
|
|
|
mode: "u=rwx,g=rwx,o=rx"
|
2021-11-02 18:47:13 -07:00
|
|
|
|
2021-11-02 16:01:30 -07:00
|
|
|
- name: Add Nodesource apt key
|
|
|
|
become: yes
|
|
|
|
apt_key:
|
|
|
|
id: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280
|
|
|
|
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
|
2021-11-02 18:47:13 -07:00
|
|
|
|
2021-11-02 16:01:30 -07:00
|
|
|
- name: Add Node v16 apt repository
|
|
|
|
become: yes
|
|
|
|
apt_repository:
|
|
|
|
repo: deb https://deb.nodesource.com/node_16.x focal main
|
2021-11-02 18:47:13 -07:00
|
|
|
|
2021-11-02 16:01:30 -07:00
|
|
|
- name: Install Node v16
|
|
|
|
become: yes
|
|
|
|
apt:
|
|
|
|
update_cache: yes
|
|
|
|
name: nodejs
|
|
|
|
state: present
|
2021-11-02 18:47:13 -07:00
|
|
|
|
2021-11-02 16:29:52 -07:00
|
|
|
- name: Install Yarn
|
|
|
|
become: yes
|
|
|
|
npm:
|
|
|
|
name: yarn
|
|
|
|
global: yes
|
2021-11-02 18:47:13 -07:00
|
|
|
|
2021-11-02 16:29:52 -07:00
|
|
|
- name: Install node-canvas dependencies
|
|
|
|
become: yes
|
|
|
|
apt:
|
|
|
|
update_cache: yes
|
|
|
|
name:
|
|
|
|
- build-essential
|
|
|
|
- libcairo2-dev
|
|
|
|
- libpango1.0-dev
|
|
|
|
- libjpeg-dev
|
|
|
|
- libgif-dev
|
|
|
|
- librsvg2-dev
|