# HG changeset patch # User Luke Hoersten # Date 1593962732 18000 # Node ID 56bffa9ef8269a01be0c3115c75a620cbcbbe3e5 # Parent 3f0ce0a546638dc25a7b4a00108034ed0ccd34e3 Added nginx and oragono HUP reloading to systemd handlers. Added nginx config. diff -r 3f0ce0a54663 -r 56bffa9ef826 nginx/handlers/main.yaml --- a/nginx/handlers/main.yaml Sat Jul 04 18:07:07 2020 -0500 +++ b/nginx/handlers/main.yaml Sun Jul 05 10:25:32 2020 -0500 @@ -2,4 +2,8 @@ - name: restart nginx become: yes - systemd: name="nginx" state="restarted" daemon_reload="yes" + systemd: name="nginx.service" state="restarted" daemon_reload="yes" + +- name: reload nginx + become: yes + systemd: name="nginx.service" state="reloaded" daemon_reload="yes" diff -r 3f0ce0a54663 -r 56bffa9ef826 nginx/tasks/main.yaml --- a/nginx/tasks/main.yaml Sat Jul 04 18:07:07 2020 -0500 +++ b/nginx/tasks/main.yaml Sun Jul 05 10:25:32 2020 -0500 @@ -3,27 +3,30 @@ - name: apt install nginx become: yes apt: name="nginx" + notify: restart nginx - name: disable default site become: yes file: path="/etc/nginx/sites-enabled/default" state="absent" + notify: reload nginx - name: install base config become: yes copy: src="nginx.conf" dest="/etc/nginx/nginx.conf" - notify: restart nginx + notify: reload nginx - name: make stream dirs become: yes file: path="/etc/nginx/streams-{{item}}" state="directory" loop: ["available", "enabled"] + notify: reload nginx - name: make config available become: yes template: src: "{{nginx_conf_src}}" dest: "/etc/nginx/{{nginx_server_type}}s-available/{{nginx_server_name}}.conf" - notify: restart nginx + notify: reload nginx - name: enable config become: yes @@ -31,14 +34,14 @@ src: "/etc/nginx/{{nginx_server_type}}s-available/{{nginx_server_name}}.conf" dest: "/etc/nginx/{{nginx_server_type}}s-enabled/{{nginx_server_name}}.conf" state: "link" - notify: restart nginx + notify: reload nginx - name: copy root files become: yes copy: src="{{nginx_root_src}}" dest="{{nginx_root_dest}}/" when: nginx_root - notify: restart nginx + notify: reload nginx - name: enable nginx service become: yes - systemd: name="nginx" enabled="yes" state="started" + systemd: name="nginx.service" enabled="yes" state="started" daemon_reload="yes" diff -r 3f0ce0a54663 -r 56bffa9ef826 oragono/handlers/main.yaml --- a/oragono/handlers/main.yaml Sat Jul 04 18:07:07 2020 -0500 +++ b/oragono/handlers/main.yaml Sun Jul 05 10:25:32 2020 -0500 @@ -3,3 +3,7 @@ - name: restart oragono become: yes systemd: name="oragono.service" state="restarted" daemon_reload="yes" + +- name: reload oragono + become: yes + systemd: name="oragono.service" state="reloaded" diff -r 3f0ce0a54663 -r 56bffa9ef826 oragono/tasks/main.yaml --- a/oragono/tasks/main.yaml Sat Jul 04 18:07:07 2020 -0500 +++ b/oragono/tasks/main.yaml Sun Jul 05 10:25:32 2020 -0500 @@ -44,14 +44,14 @@ owner: "oragono" group: "oragono" mode: "0644" - notify: restart oragono + notify: reload oragono - name: copy motd file become: yes copy: src: "{{oragono_motd}}" dest: "/etc/oragono/oragono.motd" - notify: restart oragono + notify: reload oragono - name: install oragono service become: yes diff -r 3f0ce0a54663 -r 56bffa9ef826 oragono/templates/nginx.conf.j2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/oragono/templates/nginx.conf.j2 Sun Jul 05 10:25:32 2020 -0500 @@ -0,0 +1,7 @@ +server { + listen 6697 ssl; + proxy_pass unix:/run/oragono/socket; + + ssl_certificate {{nginx_ssl_cert}}; + ssl_certificate_key {{nginx_ssl_privkey}}; +} diff -r 3f0ce0a54663 -r 56bffa9ef826 oragono/templates/oragono.yaml.j2 --- a/oragono/templates/oragono.yaml.j2 Sat Jul 04 18:07:07 2020 -0500 +++ b/oragono/templates/oragono.yaml.j2 Sun Jul 05 10:25:32 2020 -0500 @@ -288,7 +288,7 @@ # oragono will write files to disk under certain circumstances, e.g., # CPU profiling or data export. by default, these files will be written # to the working directory. set this to customize: - # output-path: "/home/oragono/out" + output-path: "/var/oragono" # account options accounts: @@ -606,7 +606,7 @@ whois-line: "server admin" # custom hostname - vhost: "ops.{{oragono_network_name}}" + vhost: "opr.{{oragono_network_name}}" # modes are the modes to auto-set upon opering-up modes: +is acjknoqtuxv