Skip to content

Commit

Permalink
Merge pull request #562 from seriv/docker-podman
Browse files Browse the repository at this point in the history
Minimal changes to work with podman-docker
  • Loading branch information
david22swan authored Apr 8, 2020
2 parents 7bab1df + 7f7d314 commit c1e2ef9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
8 changes: 7 additions & 1 deletion lib/facter/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ def interfaces
Facter.add(:docker_client_version) do
setcode do
docker_version = Facter.value(:docker_version)
docker_version['Client']['Version'] if docker_version
if docker_version
if !docker_version['Client'].nil?
docker_version['Client']['Version']
else
docker_version['Version']
end
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion manifests/run.pp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
Variant[String,Array,Undef] $after = [],
Variant[String,Array,Undef] $after_service = [],
Variant[String,Array,Undef] $depends = [],
Variant[String,Array,Undef] $depend_services = [],
Variant[String,Array,Undef] $depend_services = ['docker.service'],
Optional[Boolean] $tty = false,
Variant[String,Array,Undef] $socket_connect = [],
Variant[String,Array,Undef] $hostentries = [],
Expand Down
4 changes: 2 additions & 2 deletions templates/etc/init.d/docker-run.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<%-
@required_start = ["$network", "docker"] +
@required_start = ["$network"] +
@sanitised_after_array.map{ |s| "#{@service_prefix}#{s}"} +
@sanitised_depends_array.map{ |s| "#{@service_prefix}#{s}"} +
@depend_services_array

@required_stop = ["$network", "docker"] +
@required_stop = ["$network"] +
@sanitised_depends_array.map{ |d| "#{@service_prefix}#{d}"} +
@depend_services_array
-%>
Expand Down
12 changes: 5 additions & 7 deletions templates/etc/systemd/system/docker-run.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<%-
depend_services = @depend_services_array.map{|s| s =~ /\.[a-z]+$/ ? s : "#{s}.service"}
@after = [@service_name.nil? ? "" : "#@service_name.service"] +
@sanitised_after_array.map{ |s| "#{@service_prefix}#{s}.service"} +
@sanitised_depends_array.map{ |s| "#{@service_prefix}#{s}.service"} +
depend_services
@after = @sanitised_after_array.map{ |s| "#{@service_prefix}#{s}.service"} +
@sanitised_depends_array.map{ |s| "#{@service_prefix}#{s}.service"} +
depend_services
@wants = @sanitised_after_array.map{ |a| "#{@service_prefix}#{a}.service"}
@requires = [@service_name.nil? ? "" : "#@service_name.service"] +
@sanitised_depends_array.map{ |d| "#{@service_prefix}#{d}.service"} +
depend_services
@requires = @sanitised_depends_array.map{ |d| "#{@service_prefix}#{d}.service"} +
depend_services
-%>
# This file is managed by Puppet and local changes
# may be overwritten
Expand Down

0 comments on commit c1e2ef9

Please sign in to comment.