Git Product home page Git Product logo

ansible-role-docker-compose-generator's Issues

"Containers is undefined" error

The initial task to check the destination passes, but I receive the following error when Ansible tries to generate a docker compose file.

TASK [ironicbadger.docker_compose_generator : write docker-compose file] ******************** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: 'containers' is undefined. 'containers' is undefined fatal: [192.168.110.10]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'containers' is undefined. 'containers' is undefined"}

I am not sure why Ansible says containers is undefined. I double checked the syntax and indentation, which look okay. I used your example to A/B test and receive the same error.

I can send my playbook yaml and requirements yaml if that will be helpful.

Ansible: 2.14.4
Docker on remote host: 26.0.2
Docker compose on remote host: 2.26.1

2 dashes on command

I tried to have 2 dashes but it doesn't work, something like:
command: --nocacerts

Specifying Logging (driver, options...) not showing up in generated Compose file

Good day!
Thank you very much for this role, I have noticed a small problem though.
When I try to specify a logging configuration for a container, it never shows up in the output. Now, this very much could be a problem with my syntax and such, but I see no errors being thrown and everything else gets generated appropriately into the resulting Compose file.
Digging thru the template file, I can see where the loop exists to handle the logging settings, but they never trigger.

Example:

  • service_name: authelia
    container_name: authelia
    hostname: authelia
    image: authelia/authelia:4.32.2
    active: true
    volumes:
    • "{{ appdata_path }}/authelia:/config"
      restart: always
      include_global_env_vars: true
      logging:
      driver: "json-file"
      options:
      max-size: "200k"
      max-file: "10"

`command` breaking change

First off, I may not have thanked you yet for this amazing role. I'm using it for almost all my infrastructure. Thank you!

Wanted to open an issue for better visibility.

c5836ad is a breaking change for the command option. Might it be better to do something along these lines?

{% if container.command is defined %}
{% if container.command is string %}
    command: {{ container.command }}
{% else %}
    command:
{% for command in container.command %}
      - {{ command }}
{% endfor %}
{% endif %}
{% endif %}

I'd still like to see arrays neatly generated in my docker-compose file, as I use this to pass options to Traefik. Maybe I should be using a separate file rather than my host_vars monolith, but that's a different issue :)

Is there a functional difference in docker-compose that I'm missing? I defer to your expertise. I'd be happy to submit a PR if you're in agreement.

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.