puppetlabs / puppetlabs-docker

The Puppet Docker repository
Apache License 2.0
91 stars 309 forks source link

docker_compose provider not found when used in bolt plan #505

Closed bazzie closed 2 years ago

bazzie commented 5 years ago

First of all: I'm not exactly sure if this is a Bolt or a Puppet issue.

We make use of the docker_compose resource type in a Puppet server-client scenario on RHEL7. This works without issues.

We are planning to make more use of Bolt and plans. In this situation, the docker_compose provider is not found (nil), and the plan execution fails.

docker-compose is installed by the docker-module and works perfectly from the command line

What you expected to happen?

The docker_compose resource should be created and configured containers should start.

What happened?

The plan fails with an error that the docker_compose provider is not found.

How to reproduce it?

This code block is used in the plan:

apply_prep($targets)

apply($targets, _run_as => 'root') { include proxy_client include yum include docker include docker::compose

file { 'compose_nginx':
  ensure  => directory,
  path    => '/software/docker/compose/nginx',
  require => File['/software/docker/compose'],
}

file { 'nginx_compose':
  ensure  => present,
  path    => '/software/docker/compose/nginx/docker-compose.yaml',
  content => epp('terraform_docker/nginx/docker-compose.yaml.epp'),
}

docker_compose { 'nginx':
  ensure        => present,
  compose_files => ['/software/docker/compose/nginx/docker-compose.yaml'],
}

}

Modules are in Puppetfile and installed with 'bolt puppetfile install'

Anything else we need to know?

Versions:

$ puppet --version

6.6.0

$ docker version

Docker version 18.09.6, build 481bc77156

$ facter os

{
  architecture => "x86_64",
  family => "RedHat",
  hardware => "x86_64",
  name => "RedHat",
  release => {
    full => "7.6",
    major => "7",
    minor => "6"
  },
  selinux => {
    config_mode => "enforcing",
    config_policy => "targeted",
    current_mode => "enforcing",
    enabled => true,
    enforced => true,
    policy_version => "31"
  }
}

$ puppet module list

/etc/puppetlabs/code/environments/production/modules (no modules installed)
/etc/puppetlabs/code/modules (no modules installed)
/opt/puppetlabs/puppet/modules (no modules installed)

Logs:


{
  "Docker_compose[nginx]": {
    "title": "nginx",
    "file": "/etc/puppetlabs/code/environments/production/modules/terraform_docker/Boltdir/modules/terraform_docker/plans/init.pp",
    "line": 40,
    "resource": "Docker_compose[nginx]",
    "resource_type": "Docker_compose",
    "provider_used": null,
    "containment_path": [
      "Stage[main]",
      "Main",
      "Docker_compose[nginx]"
    ],
    "evaluation_time": null,
    "tags": [
      "docker_compose",
      "nginx",
      "class"
    ],
    "time": "2019-07-03T22:53:36.876834491+02:00",
    "failed": true,
    "failed_to_restart": false,
    "changed": false,
    "out_of_sync": false,
    "skipped": false,
    "change_count": 0,
    "out_of_sync_count": 0,
    "events": [],
    "corrective_change": false
  }
}
github-actions[bot] commented 2 years ago

This issue has been marked as stale because it has been open for a while and has had no recent activity. If this issue is still important to you please drop a comment below and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.