Code Monkey home page Code Monkey logo

Comments (6)

nickjj avatar nickjj commented on June 12, 2024

Can you show me an example of what the output looks like on your end and what you would expect to see instead?

from ansible-docker.

tyldum avatar tyldum commented on June 12, 2024

Got:

# Ansible managed

[Service]
Environment=HTTP_PROXY=http://proxy.corp:3128" "HTTPS_PROXY=http://proxy.corp:3128" "NO_PROXY=127.0.0.1/8

Expected (and got this by reversing the change):

# Ansible managed

[Service]
Environment="HTTP_PROXY=http://proxy.corp:3128" "HTTPS_PROXY=http://proxy.corp:3128" "NO_PROXY=127.0.0.1/8"

from ansible-docker.

tyldum avatar tyldum commented on June 12, 2024

variable:

docker__daemon_environment:
  - "HTTP_PROXY=http://proxy.corp:3128"
  - "HTTPS_PROXY=http://proxy.corp:3128"
  - "NO_PROXY=127.0.0.1/8"

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

I'm able to confirm that here and funny enough systemd is ok with quote mismatches so it didn't prevent the Docker daemon from starting up.

I just re-worked the template to generate multiple environment variables to be more clear by outputting each one on their own line and to avoid any quote shenanigans.

Can you double confirm it works for you by changing templates/etc/systemd/docker.service.d/environment.conf.j2 to:

# {{ ansible_managed }}

[Service]
{% for env in docker__daemon_environment %}
Environment="{{ env }}"
{% endfor %}

It should produce this output:

# Ansible managed

[Service]
Environment="HTTP_PROXY=http://proxy.a.com:80"
Environment="HTTPS_PROXY=https://proxy.a.com:443"

With an input of:

docker__daemon_environment:
  - "HTTP_PROXY=http://proxy.a.com:80"
  - "HTTPS_PROXY=https://proxy.a.com:443"

from ansible-docker.

tyldum avatar tyldum commented on June 12, 2024

It works!
Actually the single line appeared to work as well, but this is the correct way anyways.

from ansible-docker.

nickjj avatar nickjj commented on June 12, 2024

Cool.

Yeah if the quotes were lined up it should have worked on 1 line in the end.

I just pushed v1.9.1 to the Galaxy with this fix and here's the commit: beaaccb

from ansible-docker.

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.