Skip to content

Commit

Permalink
Fix #817 - startup_script fails for windows
Browse files Browse the repository at this point in the history
   * Previously the windows agent puppet code did not handle windows
     properly and failed the catalog build due to a case sensitive issue.
     This fixes that by downcase the agent name first.
  • Loading branch information
logicminds committed Mar 9, 2022
1 parent f27c9df commit a434381
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/startup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
Optional[Boolean] $manage_database = undef,
Optional[String] $service_name = $name,
) {
case $title {
case $title.downcase {
/agent/: {
assert_type(Stdlib::Absolutepath, $agent_configfile_path)
}
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@
when 'Archlinux', 'Fedora', 'Gentoo'
it { is_expected.to contain_file("/etc/init.d/#{service_name}").with_ensure('absent') }
it { is_expected.to contain_file("/etc/systemd/system/#{service_name}.service").with_ensure('file') }
when 'windows'
it { is_expected.to contain_exec("install_agent_#{service_name}")}
else
it { is_expected.to contain_file("/etc/init.d/#{service_name}").with_ensure('file') }
it { is_expected.not_to contain_file("/etc/systemd/system/#{service_name}.service") }
Expand Down

0 comments on commit a434381

Please sign in to comment.