summaryrefslogtreecommitdiffstats
path: root/roles/media/tasks
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2023-10-10 10:21:30 -0400
committerSacha Chua <sacha@sachachua.com>2023-10-10 10:21:30 -0400
commit4ef6627aa71a2c94a2ae7615d5e93d6689ac8b5a (patch)
tree9dee331d9ba8328df4dc8c448c1e1554e82ec721 /roles/media/tasks
parentf9b00ef5d578e331f0c8269e6138cdac45fc4e99 (diff)
downloademacsconf-ansible-4ef6627aa71a2c94a2ae7615d5e93d6689ac8b5a.tar.xz
emacsconf-ansible-4ef6627aa71a2c94a2ae7615d5e93d6689ac8b5a.zip
copy scripts
Diffstat (limited to '')
-rw-r--r--roles/media/tasks/main.yml19
1 files changed, 19 insertions, 0 deletions
diff --git a/roles/media/tasks/main.yml b/roles/media/tasks/main.yml
index 6eb3ab6..44374f5 100644
--- a/roles/media/tasks/main.yml
+++ b/roles/media/tasks/main.yml
@@ -1,3 +1,9 @@
+- name: Set up packages
+ ansible.builtin.apt:
+ update_cache: true
+ pkg:
+ - nginx
+ state: present
- name: Install package for setting htpasswd
package:
name: python3-passlib
@@ -22,6 +28,19 @@
template:
src: nginx-include
dest: /etc/nginx/sites-available/{{ host_name }}-{{ emacsconf_year }}-include
+- name: Create main configuration if needed
+ template:
+ src: nginx-site-config
+ dest: /etc/nginx/sites-available/{{ host_name }}
+ force: no
+- name: Make sure main configuration is enabled
+ file:
+ src: /etc/nginx/sites-available/{{ host_name }}
+ dest: /etc/nginx/sites-enabled/{{ host_name }}
+ owner: "{{ emacsconf_user }}"
+ group: "{{ emacsconf_group }}"
+ force: no
+ state: link
- name: Include it in the main configuration
lineinfile:
path: /etc/nginx/sites-available/{{ host_name }}