This repository has been archived on 2025-06-10. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
server/playbooks/roles/fic-frontend/tasks/main.yml

70 lines
1.4 KiB
YAML

---
- name: install nginx
apt: name=nginx-extras
- name: create fic user
user:
name=fic
home=/home/fic
group=nogroup
- name: remove default configuration
file:
path=/etc/nginx/sites-enabled/default
state=absent
notify: restart nginx
- name: copy htdocs
copy:
src=static/
dest=/home/fic/frontend-htdocs
- name: copy frontend binary
copy:
src=frontend
mode=755
dest=/home/fic/frontend
- name: copy htpasswd
copy:
src=ficpasswd
dest=/etc/nginx/ficpasswd
notify: restart nginx
#- name: copy frontend configuration
# copy:
# src=nginx-frontend-pam.conf
# dest=/etc/nginx/sites-available/frontend
# notify: restart nginx
- name: copy frontend configuration
copy:
src=nginx-frontend-htpasswd.conf
dest=/etc/nginx/sites-available/frontend
notify: restart nginx
- name: activate frontend configuration
file:
src=/etc/nginx/sites-available/frontend
path=/etc/nginx/sites-enabled/frontend
state=link
notify: restart nginx
- name: enable and start nginx
service:
name=nginx
enabled=yes
state=started
- name: add frontend service
copy:
src=frontend.service
dest=/lib/systemd/system/fic-frontend.service
- name: reload systemd
command: systemctl daemon-reload
- name: enable and start fic-frontend
service:
name=fic-frontend
enabled=yes
state=started