geerlingguy / ansible-role-varnish

Ansible Role - Varnish HTTP accelerator
https://galaxy.ansible.com/geerlingguy/varnish/
MIT License
80 stars 88 forks source link

FIX #32: Ensure Varnish services start on system boot #33

Closed csegarra closed 7 years ago

csegarra commented 8 years ago

I update the setup-Debian.yml task, so it ensures the Varnish services will be enabled on system boot.

When using service module I hit a bug [0], fixed a few days ago, but still on the devel branch. Because this bug, services are not enabled if the system has SysV and systemd configuration files, like Debian Jessie has.

Therefore, in the case of Debian Jessie, I make a workaround using the command module to call directly to systemctl.

I also update the installation steps following the current recomendations for Debian / Ubuntu on Varnish site [1][2].

These changes are:

  1. Using HTTPS for the repo URL.
  2. Because of 1, apt-transport-https must be installed.
  3. The GPG key is unique for both distributions (The old URLs still works).
  4. Debian and Ubuntu have different subdirectories in the repo (But, apparently, both have the same content).

[0] https://github.com/ansible/ansible-modules-core/issues/3764 [1] https://varnish-cache.org/releases/install_debian.html#install-debian [2] https://varnish-cache.org/releases/install_ubuntu.html#install-ubuntu

geerlingguy commented 8 years ago

I'm going to test this soon... some good changes in here that have already been beneficial in other roles.

lukasojd commented 7 years ago

+1