docker::stack unless and onlyif were doing "docker stack deploy ls" #231
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Both execs are running "docker stack deploy ls" in their unless and onlyif. This is not a command so it would fail every time, returning exit code of 1. This means one exec runs every puppet run and one will never run.
The docker stack deploy that creates the stack will always run. This may have a positive side-effect b/c docker stack deploy will create or update the stack, so maybe if the compose file has changed it will detect that and recreate it? It doesn't fail even if the stack is already created and leaves the stack alone (as far as I can tell). Maybe the unless should just be removed so it will create/update every puppet run? Or maybe it should be refreshonly and another exec could notify it if the stack doesn't exist? That way the refreshonly exec could be notified by whoever is managing the docker-compose.yaml file?
I assume the onlyif on exec that does "docker stack rm ${stackname}" will never run because the onlyif (doing "docker stack deploy ls") will always return 1 due to invalid command.