Git Product home page Git Product logo

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

Hey ๐Ÿ‘‹, I'm Alex AKA IronicBadger

Father. Podcaster - @selfhostedshow. Photographer. Tinkerer. Tailscalar.

Linkedin Mastodon Matrix Twitter Reddit

๐Ÿ“บ Latest YouTube Videos

Hardware VLOG | Upgrading the Perfect Media Server with an Intel i5-13600k and Supermicro X13-SAE-F Hardware Vlog | Friday night building servers with Alex! Alex rewires his rack with a Unifi PDU Pro, an 8 port HDMI PiKVM switch and installs new hard drives An Epyc Homelab Monster: the Perfect Media Server mega upgrade My Perfect Media Server isn't so perfect anymore... An Unbiased Comparison of the Prusa MK3 vs Bambu Lab X1-Carbon

๐Ÿ“Š Stats

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

Contributors

coredotbin avatar ironicbadger avatar itsamenathan avatar jasonlearst avatar lmilius avatar mrwacky42 avatar pastalino avatar solidrhino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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

`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.

"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"

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.