Code Monkey home page Code Monkey logo

Comments (7)

geerlingguy avatar geerlingguy commented on June 8, 2024

@wesnick - Don't have time to gather context right now, but is the systemd config also managed by this role? If so, can we just change the 127.0.0.1 to localhost?

Otherwise, it would be okay to have some parts of /etc/default/varnish managed by this role (I thought I remember managing bits of it in the past)—I'd prefer to be surgical about it, e.g. using lineinfile.

from ansible-role-varnish.

geerlingguy avatar geerlingguy commented on June 8, 2024

Also, it looks like we should be using the systemd config file (and not /etc/default/varnish) for Xenial: https://github.com/geerlingguy/ansible-role-varnish/blob/master/tasks/main.yml#L36-L45

from ansible-role-varnish.

wesnick avatar wesnick commented on June 8, 2024

I checked upstream. It looks like the reload script in the systemd config file is a holdover from init.d days
https://bugs.launchpad.net/ubuntu/+source/varnish/+bug/1573561

In this script the old /etc/default/varnish file is sourced

$ cat /usr/share/varnish/reload-vcl |grep defaults
defaults=/etc/default/varnish
# msg_defaults_not_readable: defaults
msg_defaults_not_readable="Error: %s is not readable\n"
# msg_defaults_not_there: defaults
msg_defaults_not_there="Error: %s does not exist\n"
# Load defaults file
if [ -f "$defaults" ]
    if [ -r "$defaults" ]
	. "$defaults"
	printf >&2 "$msg_defaults_not_readable" $defaults
    printf >&2 "$msg_defaults_not_there" $defaults

I propose a patch that will only affect xenial, do a lineinfile on the line

defaults=/etc/default/varnish

and set it to

defaults=/etc/varnish/varnish.params

In reality this varnish.params file is not ever used by systemd, it is not loaded in the config file and even if it were, systemd does not do param expansion the way init.d scripts did.
http://unix.stackexchange.com/questions/216780/why-does-bash-parameter-expansion-not-work-inside-systemd-service-files

from ansible-role-varnish.

wesnick avatar wesnick commented on June 8, 2024

another interesting link
varnishcache/pkg-varnish-cache#24

from ansible-role-varnish.

wesnick avatar wesnick commented on June 8, 2024

I have implemented the above fix in a forked version of this repo and reload works great for me now. I am willing to roll a patch only targeting xenial and add a test. Just say the word.

from ansible-role-varnish.

stale avatar stale commented on June 8, 2024

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

from ansible-role-varnish.

stale avatar stale commented on June 8, 2024

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

from ansible-role-varnish.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.