Add frontend playbook
This commit is contained in:
parent
3bcffbe251
commit
4a625bf3eb
9 changed files with 447 additions and 0 deletions
70
playbooks/roles/fic-frontend/tasks/main.yml
Normal file
70
playbooks/roles/fic-frontend/tasks/main.yml
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
---
|
||||
- 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
|
||||
Reference in a new issue