geerlingguy / ansible-role-varnish

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

task "Ensure Varnish services are started and enabled on startup." is skipped on Ubuntu Bionic #92

Closed it-percona closed 4 years ago

it-percona commented 4 years ago

There is a check for ansible_os_family that restricts this working on Ubuntu bionic

- name: Ensure Varnish services are started and enabled on startup.
  service:
    name: "{{ item }}"
    state: started
    enabled: true
  with_items: "{{ varnish_enabled_services | default([]) }}"
  when: >
    varnish_enabled_services and
    (ansible_os_family != 'Debian' and ansible_distribution_release != "xenial")

Should just be:

- name: Ensure Varnish services are started and enabled on startup.
  service:
    name: "{{ item }}"
    state: started
    enabled: true
  with_items: "{{ varnish_enabled_services | default([]) }}"
  when: >
    varnish_enabled_services and (ansible_os_family != 'Debian' or
    (ansible_os_family == 'Debian' and ansible_distribution_release != "xenial"))
geerlingguy commented 4 years ago

You're correct: https://travis-ci.org/geerlingguy/ansible-role-varnish/jobs/650948242#L558-L567