Wrapping a Salt Module 0 ▲ blog on PaulTraylor.net 170 days ago · Tech · hide · Fediverse post I use saltstack to manage deployment of docker containers in my homelab. For two of my cloud servers, I am running them in memory constrained environments for cost reasons, and typically only run the minimum required there. Since I wanted to wrap the docker_container module, I started by creating my own state in _states/docker_customized. I can do a simple naive version, just by using setdefault # _states/docker_customized.py def running(name, **kwargs): kwargs.setdefault("mem_limit", "1024M") kwargs.setdefault("oom_score_adj", 100) return __states__["docker_container.running"](name, **kwargs) If I then do a find replace on s/docker_container.running/docker_customized.running/g, then when I use state.apply on a target, it will call my method, update the values I want, before calling the original with the updated parameters (I may also need to update any watch or requires entires as needed). I can then take this further, and do more specific logic, like basing the limit on the server… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town