diff --git a/1613725221862.jpg.tmp b/1613725221862.jpg.tmp new file mode 100644 index 0000000..3787be8 Binary files /dev/null and b/1613725221862.jpg.tmp differ diff --git a/stopvarnish.yml b/stopvarnish.yml new file mode 100755 index 0000000..9edc276 --- /dev/null +++ b/stopvarnish.yml @@ -0,0 +1,72 @@ +--- +- hosts: all + become: True + + tasks: + - name: Create conf directory + ansible.builtin.file: + path: /etc/systemd/system/varnish.service.d + state: directory + mode: '0655' + + - name: Dropping config in conf directory + ansible.builtin.template: + src: templates/customexec.conf.j2 + dest: /etc/systemd/system/varnish.service.d/customexec.conf + mode: '0655' + owner: root + group: root + + - name: Dropping Varnish config (default.vcl) + ansible.builtin.template: + src: templates/default.vcl.j2 + dest: /etc/varnish/default.vcl + mode: '0644' + force: yes + + - name: Reload daemons, enable varnish + ansible.builtin.systemd: + daemon_reload: yes + name: varnish.service + enabled: no + state: stopped + + - name: Modfying Apache default port + ansible.builtin.lineinfile: + path: /etc/apache2/ports.conf + regexp: '^Listen 8080$' + line: 'Listen 80' + + - name: Find all enabled vhosts + ansible.builtin.find: + paths: /etc/apache2/sites-available + patterns: "*.conf" + follow: yes + file_type: file + register: vhosts + + - name: dbg + ansible.builtin.debug: + var: vhosts.files + + - name: Modfying VHosts + ansible.builtin.replace: + path: "{{ item.path }}" + regexp: '^\<[Vv]irtual[Hh]ost \*:8080\>$' + replace: "" + with_items: + - "{{ vhosts.files }}" + + - name: Activating Apache Headers Mod + community.general.apache2_module: + state: present + name: headers + identifier: headers_module + + - name: Restart Varnish and Apache + ansible.builtin.systemd: + name: "{{ item }}" + state: restarted + with_items: + - "apache2.service" +