Add all files needed to bring up VM and run agaric.com locally
This commit is contained in:
parent
52c8b60bac
commit
4d2bc0ee24
742 changed files with 24037 additions and 0 deletions
95
box/provisioning/roles/geerlingguy.varnish/tasks/main.yml
Normal file
95
box/provisioning/roles/geerlingguy.varnish/tasks/main.yml
Normal file
|
@ -0,0 +1,95 @@
|
|||
---
|
||||
- name: Include OS-specific variables.
|
||||
include_vars: "{{ ansible_os_family }}.yml"
|
||||
|
||||
- name: Set the packagecloud repository name based on the version.
|
||||
set_fact:
|
||||
varnish_packagecloud_repo: "varnish{{ varnish_version|replace('.', '') }}"
|
||||
|
||||
- include: setup-RedHat.yml
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
- include: setup-Debian.yml
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- name: Ensure Varnish config path exists.
|
||||
file:
|
||||
path: "{{ varnish_config_path }}"
|
||||
state: directory
|
||||
|
||||
- name: Copy Varnish configuration (sysvinit).
|
||||
template:
|
||||
src: varnish.j2
|
||||
dest: "{{ varnish_sysvinit_config_path }}/varnish"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: >
|
||||
(ansible_os_family == 'RedHat' and ansible_distribution_major_version|int < 7) or
|
||||
(ansible_os_family == 'Debian' and ansible_distribution_release != "xenial")
|
||||
|
||||
- name: Copy Debian Jessie/Xenial specific Varnish configs (systemd).
|
||||
template:
|
||||
src: varnish.service.j2
|
||||
dest: "{{ varnish_systemd_config_path }}/varnish.service"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: >
|
||||
(ansible_distribution == 'Debian' and ansible_distribution_version|int >= 8) or
|
||||
(ansible_distribution == 'Ubuntu' and ansible_distribution_version.split(".")[0]|int >= 16)
|
||||
notify:
|
||||
- reload systemd
|
||||
- restart varnish
|
||||
|
||||
- name: Copy Varnish configuration (systemd).
|
||||
template:
|
||||
src: varnish.params.j2
|
||||
dest: "{{ varnish_config_path }}/varnish.params"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: >
|
||||
(ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >= 7) or
|
||||
(ansible_os_family == 'Debian' and ansible_distribution_release == "xenial")
|
||||
|
||||
- name: Copy Varnish default VCL.
|
||||
template:
|
||||
src: "{{ varnish_default_vcl_template_path }}"
|
||||
dest: "{{ varnish_config_path }}/default.vcl"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: varnish_use_default_vcl
|
||||
notify: restart varnish
|
||||
|
||||
- name: Copy varnish secret.
|
||||
template:
|
||||
src: secret.j2
|
||||
dest: "{{ varnish_config_path }}/secret"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: restart varnish
|
||||
|
||||
- name: Ensure Varnish services are started and enabled on startup.
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
state: started
|
||||
enabled: yes
|
||||
with_items: "{{ varnish_enabled_services | default([]) }}"
|
||||
when: >
|
||||
varnish_enabled_services and
|
||||
(ansible_os_family != 'Debian' and ansible_distribution_release != "xenial")
|
||||
|
||||
# See: https://github.com/ansible/ansible/issues/22303
|
||||
- name: Ensure Varnish services are started enabled on startup (Xenial specific)
|
||||
service:
|
||||
name: "{{ item }}"
|
||||
state: started
|
||||
enabled: yes
|
||||
use: "service"
|
||||
with_items: "{{ varnish_enabled_services | default([]) }}"
|
||||
when:
|
||||
- varnish_enabled_services
|
||||
- (ansible_os_family == 'Debian' and ansible_distribution_release == "xenial")
|
Loading…
Add table
Add a link
Reference in a new issue