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::run ensure=> 'absent' inconsistent #717

Closed
Justin-DynamicD opened this issue Sep 7, 2017 · 1 comment
Closed

docker::run ensure=> 'absent' inconsistent #717

Justin-DynamicD opened this issue Sep 7, 2017 · 1 comment

Comments

@Justin-DynamicD
Copy link

Justin-DynamicD commented Sep 7, 2017

I have a "cute" scenario where I call docker::run and pass parameters but I actually pass either ensure 'present' or 'absent' depending on a parameter.

the actual class:

  docker::run { 'mysqld-exporter' :
      ensure  => $mysqlwatcher,
      image   => "${mysqld_exporter_image}:v${mysqld_exporter_version}",
      ports   => "${mysqld_exporter_port}:${mysqld_exporter_port}",
      net     => 'host',
      env     => "DATA_SOURCE_NAME=exporter:exporter@(${facts['fqdn']})/",
      command => "-web.listen-address=0.0.0.0:${mysqld_exporter_port}",
    }

On most machines this appears to work. Without a consistent reason, however, some machines will error if the container service isn't found rather than silently continue:

Error: /Stage[main]/<redacted>/Service[docker-mysqld-exporter]: Could not evaluate: Could not find init script or upstart conf file for 'docker-mysqld-exporter'

I would expect, as ensure is set to absent, that t would silently continue if said service wasn't found and simply move on. Instead I get an error.

EDIT: I've narrowed it down to being an issue specific to Ubuntu 14.04.5 LTS. Perhaps something unique with how that build handles services? Not certain

@Justin-DynamicD
Copy link
Author

I discovered this occurs with ANY module that leverages service removal in this manner on Ubuntu 14. As this isn't a docker specific issue ... Ill close this request.

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

1 participant