|
381 | 381 | fail("agent_major_version must be either 5, 6 or 7, not ${_agent_major_version}") |
382 | 382 | } |
383 | 383 |
|
384 | | - if ($::operatingsystem == 'Windows' and $windows_ddagentuser_name != undef) { |
| 384 | + if ($facts['os']['name'] == 'Windows' and $windows_ddagentuser_name != undef) { |
385 | 385 | $dd_user = $windows_ddagentuser_name |
386 | 386 | } else { |
387 | 387 | $dd_user = $datadog_agent::params::dd_user |
|
423 | 423 |
|
424 | 424 | # Install agent |
425 | 425 | if $manage_install { |
426 | | - case $::operatingsystem { |
| 426 | + case $facts['os']['name'] { |
427 | 427 | 'Ubuntu','Debian','Raspbian' : { |
428 | 428 | if $use_apt_backup_keyserver != undef or $apt_backup_keyserver != undef or $apt_keyserver != undef { |
429 | 429 | notify { 'apt keyserver arguments deprecation': |
|
477 | 477 | rpm_repo_gpgcheck => $rpm_repo_gpgcheck, |
478 | 478 | } |
479 | 479 | } |
480 | | - default: { fail("Class[datadog_agent]: Unsupported operatingsystem: ${::operatingsystem}") } |
| 480 | + default: { fail("Class[datadog_agent]: Unsupported operatingsystem: ${facts['os']['name']}") } |
481 | 481 | } |
482 | 482 | } else { |
483 | 483 | if ! defined(Package[$agent_flavor]) { |
|
496 | 496 | service_provider => $service_provider, |
497 | 497 | } |
498 | 498 |
|
499 | | - if ($::operatingsystem != 'Windows') { |
| 499 | + if ($facts['os']['name'] != 'Windows') { |
500 | 500 | if ($dd_groups) { |
501 | 501 | user { $dd_user: |
502 | 502 | groups => $dd_groups, |
|
516 | 516 |
|
517 | 517 | if $_agent_major_version == 5 { |
518 | 518 |
|
519 | | - if ($::operatingsystem == 'Windows') { |
| 519 | + if ($facts['os']['name'] == 'Windows') { |
520 | 520 | fail('Installation of agent 5 with puppet is not supported on Windows') |
521 | 521 | } |
522 | 522 |
|
|
752 | 752 | $agent_config = deep_merge($_agent_config, $extra_config) |
753 | 753 |
|
754 | 754 |
|
755 | | - if ($::operatingsystem == 'Windows') { |
| 755 | + if ($facts['os']['name'] == 'Windows') { |
756 | 756 |
|
757 | 757 |
|
758 | 758 | file { 'C:/ProgramData/Datadog': |
|
0 commit comments