diff options
author | Sacha Chua <sacha@sachachua.com> | 2025-01-17 15:22:21 -0500 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2025-01-17 15:22:21 -0500 |
commit | 775f23e5ea17874cd24ce265171f6bdf2b1b942c (patch) | |
tree | 9c48e130bcaea594d779608bb70c601b53ee9b56 /roles/upload/tasks/main.yml | |
parent | 0a81562e745b218fba542a32d962cb5415f6686a (diff) | |
download | emacsconf-ansible-775f23e5ea17874cd24ce265171f6bdf2b1b942c.tar.xz emacsconf-ansible-775f23e5ea17874cd24ce265171f6bdf2b1b942c.zip |
Diffstat (limited to 'roles/upload/tasks/main.yml')
-rw-r--r-- | roles/upload/tasks/main.yml | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/roles/upload/tasks/main.yml b/roles/upload/tasks/main.yml index ca87a1c..b63e3f1 100644 --- a/roles/upload/tasks/main.yml +++ b/roles/upload/tasks/main.yml @@ -21,6 +21,14 @@ name: - nodejs state: present +- name: Add to dehydrated.conf + become: true + lineinfile: + line: "{{ upload_server_name }}" + path: /etc/dehydrated/domains.txt +- name: Create or renew cert + command: "dehydrated --cron" + become: true - name: Create upload user become: true user: @@ -99,6 +107,19 @@ owner: "{{ upload_user }}" group: "{{ upload_group }}" recurse: true +- name: Create backup dir to use when the conference is done + file: + path: "{{ upload_done_dir }}" + owner: "{{ upload_user }}" + group: "{{ upload_group }}" + state: directory +- name: Create backup file to use when the conference is done + template: + src: index.html + owner: "{{ upload_user }}" + group: "{{ upload_group }}" + mode: 0755 + dest: "{{ upload_done_dir }}/index.html" - name: Install systemd configuration tags: system become: true @@ -109,6 +130,23 @@ group: root mode: 0755 when: not use_initd +- name: Create main configuration if needed + template: + src: nginx-site-config + dest: /etc/nginx/sites-available/{{ upload_server_name }} +- name: Make sure main configuration is enabled + file: + src: /etc/nginx/sites-available/{{ upload_server_name }} + dest: /etc/nginx/sites-enabled/{{ upload_server_name }} + owner: "{{ emacsconf_user }}" + group: "{{ emacsconf_group }}" + force: no + state: link +- name: Reload configuration + become: true + service: + name: nginx + state: reloaded - name: Restart Upload become: true when: upload_enabled |