nickjj / ansible-docker

Install / Configure Docker and Docker Compose using Ansible.
MIT License
750 stars 224 forks source link

Add way to add additional packages to install #109

Closed smacz42 closed 3 years ago

smacz42 commented 3 years ago

In a similar way that docker__default_pip_packages has docker__pip_packages that allows for additional packages to be installed via pip, there should be a corollary for docker__package_dependencies that allows for an addition to the list, without having to override that variable completely.

For instance, if I have a pip package that I need to install that has a requirement on a package to be installed via apt (e.g. python-systemd relies on pkg-config) I can install that apt package as an additional packages to the ones that are installed by default. This has the additional benefit of letting me delegate the "default" packages to be installed upstream to this role.

nickjj commented 3 years ago

Hi,

Do you have a use case where you can't install Docker without the current set of apt packages?

IMO it's a really fine line with apt packages because wanting to add custom packages unrelated to installing Docker itself doesn't feel like something to optimize for in this role.

smacz42 commented 3 years ago

Do you have a use case where you can't install Docker without the current set of apt packages?

No. I can install docker just fine with the pkgs installed. And taking that point of view, I can have the necessary apt packages installed outside of that role before it is called.

nickjj commented 3 years ago

Sounds good, yeah usually with roles I try to break them up to solve 1 problem. I wouldn't avoid creating more roles, even if they are pretty small.