-
Notifications
You must be signed in to change notification settings - Fork 321
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
Error: Could not find a suitable provider for docker_compose #742
Comments
Also seeing this, seems the provider doesnt use the full path to docker-compose, which is in /usr/local/bin. (when managed by this module), but /usr/local/bin is not in the default PATH for puppet on my servers. |
Same here. Using version |
Quick fix by linking class { '::docker::compose':
ensure => present,
version => '1.29.2',
}
file { '/usr/bin/docker-compose':
ensure => link,
target => '/usr/local/bin/docker-compose',
require => Class['::docker::compose'],
}
docker_compose { 'test':
...
require => File['/usr/bin/docker-compose'],
} |
I force the docker-compose path in After (failed) applying catalog: It seems that only works when docker-ce is installed previously manually (before executing puppet agent --test) |
I use puppet to provision a temporary AWS EC2 instance (which will be destroyed after tests have finished). So in my case it is essential that it works on the first run. However I get this same error message
Maybe the provider could be instructed to use an absolute path instead of relying on the PATH environment variable, although at this point I'm not confident it might fix my issue. Would be happy to test though.. It's quite cumbersome to debug as I need to re-create an EC2 instance for each attempt to be able to reproduce the issue. |
@markri or anyone else, did you ever find a solution? I'm getting the same thing on Ubuntu 20.04, also on EC2. Same behaviors - clean install (destroy and recreate EC2), I have to run puppet apply twice, symlink doesn't work. The only crude workaround I've found is to install Docker and Docker-Compose in the user-data init script. Before puppet ever runs. But this defeats the purpose of using this module.
|
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. |
Yes please, again, this is important because we're currently having to run puppet apply twice. |
I use the sed script below to fix this issue, noting that it uses fixed Linux paths (not windows). I attempted to use an exec within the has_command thus, but it returns nil:
I still find that a second puppet run is required when |
@marrajo-afk I have created a pull request at #833. Can other users please test and verify these changes? Thanks. |
Closed by #833 |
Describe the Bug
When use classes docker and docker::compose in an own class (lamp) , the first puppet agent execution failed with:
Error: Could not find a suitable provider for docker_compose
It only works when the docker-ce package is installed manually in the node before the first puppet agent is run in it.
lamp/init.pp:
include docker
include docker::compose
Class['docker::compose'] ->
Class['docker'] ->
File['docker-compose'] ->
Docker_compose['lamp']
file { "docker-compose":
name => "/var/pr1/docker-compose.yml",
replace => true,
content => template("lamp/docker-compose.erb"),
notify => Docker_Compose['lamp']
}
docker_compose { 'lamp':
compose_files => ['/var/pr1//docker-compose.yml'],
ensure => present,
}
If i change the order of execution, the result is the same, i.e:
Class['docker'] ->
Class['docker::compose'] ->
....
....
docker/manifest/params.pp:
$compose_install_path = '/usr/bin'
$compose_version = '1.29.1'
After the failed execution, both docker-compose executable and docker-ce packages are correctly installed
Expected Behavior
Correct execution of docker_compose Resource Type
Environment
Puppet master:
Foreman 2.2
Debian 10
module puppetlabs-docker (v4.0.0)
Puppet v7.5.0
Agent:
Debian10
Puppet v7.5.0
Thanks.
The text was updated successfully, but these errors were encountered: