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

unless in docker::exec not working for me #615

Open
erikbotta opened this issue Dec 28, 2016 · 1 comment
Open

unless in docker::exec not working for me #615

erikbotta opened this issue Dec 28, 2016 · 1 comment

Comments

@erikbotta
Copy link

docker::exec { 'Start postfix':
  detach       => true,
  container    => 'zabbix-server',
  command      => 'postfix start',
  tty          => true,
  unless       => 'test -f /var/spool/postfix/pid/master.pid',
  }
  • When I run manually postfix run on container -> master.pid is made

  • When I comment out unless section -> docker::exec is executed every puppet cycle.

But how to run it only once to run postfix ? I tried in unless : ls , test -e , test -f , ! test -f .
It seems all of it is preventing to run docker::exec

@erikbotta erikbotta changed the title unless in docker:exec not working for me unless in docker::exec not working for me Dec 28, 2016
@gilesdring
Copy link

I noticed this. The issue is that when running detached, the return code is always 0, even from the unless statement. Workaround: do not run detached.

Should probably unset detached for the unless test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants