-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3cd4f8e
commit 1abc1d4
Showing
5 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- name: Restart AoCaaS | ||
ansible.builtin.service: | ||
name: aocaas | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
- name: Create user for AoCaaS | ||
ansible.builtin.user: | ||
name: aosaas | ||
home: /var/www/aocaas | ||
shell: /usr/sbin/nologin | ||
system: true | ||
state: present | ||
|
||
- name: Download and extract the AoCaaS binary | ||
ansible.builtin.get_url: | ||
# Fix this later | ||
url: https://github.com/svsticky/AoCaaS/actions/runs/12240600267/artifacts/2295080056 | ||
dest: /var/www/aocaas/bin/artifact.zip | ||
owner: aocaas | ||
group: aocaas | ||
mode: '775' | ||
notify: restart aocaas | ||
|
||
- name: Extract the AoCaaS binary | ||
ansible.builtin.unarchive: | ||
src: /var/www/aocaas/bin/artifact.zip | ||
dest: /var/www/aocaas/ | ||
notify: restart aocaas | ||
|
||
- name: Copy nginx configuration | ||
ansible.builtin.template: | ||
src: aocaas.conf.j2 | ||
dest: /etc/nginx/sites-enabled/aocaas.{{ canonical_hostname }}.conf | ||
notify: reload nginx | ||
|
||
- name: Template systemd service file | ||
ansible.builtin.template: | ||
src: aocaas.service.j2 | ||
dest: /etc/systemd/system/aocaas.service | ||
notify: restart aocaas | ||
|
||
- name: Run `aocaas` service | ||
ansible.builtin.systemd: | ||
unit: aocaas.service | ||
state: started | ||
enabled: true | ||
daemon-reload: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# {{ ansible_managed }} | ||
|
||
server { | ||
listen 443 ssl http2; | ||
listen [::]:443 ssl http2; | ||
|
||
server_name aoc.{{ canonical_hostname }}; | ||
|
||
ssl_certificate /etc/letsencrypt/live/aocaas.{{ canonical_hostname }}/fullchain.pem; | ||
ssl_certificate_key /etc/letsencrypt/live/aocaas.{{ canonical_hostname }}/privkey.pem; | ||
ssl_trusted_certificate /etc/letsencrypt/live/aocaas.{{ canonical_hostname }}/chain.pem; | ||
|
||
include includes/security-headers.conf; | ||
|
||
location /{ | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto https; | ||
proxy_intercept_errors on; | ||
proxy_pass http://localhost:3456; // ! | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# {{ ansible_managed }} | ||
|
||
[Unit] | ||
Description=Run AoCaaS | ||
OnFailure=failure-notificator@%n.service | ||
|
||
[Service] | ||
Type=simple | ||
User=aocaas | ||
Group=aocaas | ||
Restart=always | ||
WorkingDirectory=/var/www/aocaas | ||
ExecStart=/var/www/aocaas/bin/aocaas | ||
|
||
[Install] | ||
WantedBy=multi-user.target |