mirror of
https://github.com/ruanbekker/dev-environment-vagrant.git
synced 2026-08-25 09:11:00 +02:00
Add ansible role
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
---
|
||||
- name: Copy nginx configuration in place.
|
||||
template:
|
||||
src: nginx.conf.j2
|
||||
dest: /etc/nginx/nginx.conf
|
||||
owner: root
|
||||
group: "{{ root_group }}"
|
||||
mode: 0644
|
||||
notify:
|
||||
- reload nginx
|
||||
|
||||
- name: Remove default nginx vhost config file (if configured).
|
||||
file:
|
||||
path: "{{ nginx_default_vhost_path }}"
|
||||
state: absent
|
||||
when: nginx_remove_default_vhost | bool
|
||||
notify: restart nginx
|
||||
|
||||
- name: Ensure nginx_web_root exists.
|
||||
file:
|
||||
path: "{{ nginx_web_root }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
notify: reload nginx
|
||||
|
||||
- name: Ensure nginx_web_root exists.
|
||||
file:
|
||||
path: "{{ nginx_web_root }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
notify: reload nginx
|
||||
|
||||
- name: copy promtail systemd unit
|
||||
copy:
|
||||
src: styles.css
|
||||
dest: "{{ nginx_web_root }}/styles.css"
|
||||
owner: root
|
||||
group: "{{ root_group }}"
|
||||
mode: 0644
|
||||
notify: reload nginx
|
||||
|
||||
- name: Add website files
|
||||
template:
|
||||
src: index.html.j2
|
||||
dest: "{{ nginx_web_root }}/index.html"
|
||||
owner: root
|
||||
group: "{{ root_group }}"
|
||||
mode: 0644
|
||||
notify: reload nginx
|
||||
|
||||
- name: Add managed vhost config files.
|
||||
template:
|
||||
src: app.conf.j2
|
||||
dest: "{{ nginx_conf_path }}/app.conf"
|
||||
force: true
|
||||
owner: root
|
||||
group: "{{ root_group }}"
|
||||
mode: 0644
|
||||
notify: reload nginx
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
# tasks file for website
|
||||
- include_tasks: setup-ubuntu.yml
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
|
||||
# vhost configuration.
|
||||
- import_tasks: configuration.yml
|
||||
|
||||
- name: Ensure nginx service is running as configured.
|
||||
service:
|
||||
name: nginx
|
||||
state: started
|
||||
enabled: true
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Ensure dirmngr and nginx is installed
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
- dirmngr
|
||||
- nginx
|
||||
Reference in New Issue
Block a user