-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.yml
46 lines (41 loc) · 1.29 KB
/
site.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
- name: "Deploy a single-node XSnippet instance"
hosts: xsnippet
pre_tasks:
# When Ansible is connected via unprivileged user, and 'become_user' is not
# root, Ansible requires 'acl' to share the ansible module between two
# unprivileged users.
#
# https://docs.ansible.com/ansible-core/2.12/user_guide/become.html#risks-of-becoming-an-unprivileged-user
- name: Install prerequisite packages
ansible.builtin.apt:
name: acl
state: present
become: true
roles:
- role: firewall
- role: volume
when: volume_device is defined
- role: postgres
- role: caddy
- role: xsnippet_api
- role: xsnippet_raw
- role: xsnippet_web
- role: goaccess
- name: "Smoke test"
hosts: localhost
vars:
_validate_certs: "{{ lookup('env', 'CI') is falsy }}"
tasks:
- name: Test that xsnippet-api is up and running
ansible.builtin.uri:
url: "https://{{ xsnippet_api_server_name }}/v1/snippets"
method: GET
status_code: 200
validate_certs: "{{ _validate_certs }}"
- name: Test that xsnippet-web is up and running
ansible.builtin.uri:
url: "https://{{ xsnippet_web_server_name }}"
method: GET
status_code: 200
validate_certs: "{{ _validate_certs }}"