Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker::stack unless and onlyif were doing "docker stack deploy ls" #231

Merged
merged 1 commit into from
May 15, 2018

Conversation

hdeadman
Copy link
Contributor

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.

"docker stack deploy ls" is not a command so it would fail every time, returning exit code of 1

This means 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. 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.
@scotty-c
Copy link
Contributor

LGTM

@scotty-c scotty-c merged commit 38c04a3 into puppetlabs:master May 15, 2018
@MWilsonPuppet MWilsonPuppet added this to the V2.0.0 milestone Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants