Skip to content

Commit

Permalink
(CLOUD-1560)-adding-functionality to remove systemd service files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Wilson committed Nov 28, 2017
1 parent 0fc85d1 commit c3e7a94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manifests/run.pp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@
timeout => 0
}

File { "/etc/systemd/system/${service_prefix}${sanitised_title}.service":
ensure => absent,
path => "/etc/systemd/system/${service_prefix}${sanitised_title}.service",
}
}
else {
file { $initscript:
Expand Down
1 change: 1 addition & 0 deletions spec/acceptance/docker_full_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class { 'docker':}
sleep 15

shell('docker inspect container-3-6', :acceptable_exit_codes => [1])
shell('test -f /etc/systemd/system/container-3-6.service', :acceptable_exit_codes => [1])
end
end

Expand Down
1 change: 1 addition & 0 deletions spec/defines/run_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@
it { should compile.with_all_deps }
it { should contain_service('docker-sample').with_ensure(false) }
it { should contain_exec("remove container docker-sample").with_command('docker rm -v sample') }
it { should_not contain_file('docker-sample.service')}
end

end
Expand Down

0 comments on commit c3e7a94

Please sign in to comment.