diff --git a/REFERENCE.md b/REFERENCE.md
index dcaf0f49..9230555c 100644
--- a/REFERENCE.md
+++ b/REFERENCE.md
@@ -74,7 +74,6 @@
* [`infrastatus`](#infrastatus): Runs puppet infra status and returns the output
* [`mkdir_p_file`](#mkdir_p_file): Create a file with the specified content at the specified location
* [`mv`](#mv): Wrapper task for mv command
-* [`os_identification`](#os_identification): Return the operating system runnin gon the target as a string
* [`pe_install`](#pe_install): Install Puppet Enterprise from a tarball
* [`pe_ldap_config`](#pe_ldap_config): Set the ldap config in the PE console
* [`pe_uninstall`](#pe_uninstall): Uninstall Puppet Enterprise
@@ -1325,12 +1324,6 @@ Data type: `String`
New path of file
-### `os_identification`
-
-Return the operating system runnin gon the target as a string
-
-**Supports noop?** false
-
### `pe_install`
Install Puppet Enterprise from a tarball
diff --git a/metadata.json b/metadata.json
index 65f9ea53..3c44ff8f 100644
--- a/metadata.json
+++ b/metadata.json
@@ -35,6 +35,10 @@
{
"name": "puppetlabs/ruby_task_helper",
"version_requirement": ">= 1.0.0 < 2.0.0"
+ },
+ {
+ "name": "puppetlabs/facts",
+ "version_requirement": ">= 1.6.0 < 2.0.0"
}
],
"operatingsystem_support": [
diff --git a/plans/util/retrieve_and_upload.pp b/plans/util/retrieve_and_upload.pp
index 51002d28..357b139b 100644
--- a/plans/util/retrieve_and_upload.pp
+++ b/plans/util/retrieve_and_upload.pp
@@ -29,8 +29,8 @@
|-HEREDOC
# lint:endignore
- $operating_system = run_task('peadm::os_identification', 'local://localhost')
- $os_string =$operating_system.first.value['_output']
+ $operating_system = run_task('facts', 'local://localhost')
+ $os_string =$operating_system.first.value['os']['family']
if 'windows' in $os_string {
$exists = run_command("[System.IO.File]::Exists('${local_path}')", 'local://localhost')
diff --git a/spec/plans/util/retrieve_and_upload_spec.rb b/spec/plans/util/retrieve_and_upload_spec.rb
index a13f45da..feb18f1b 100644
--- a/spec/plans/util/retrieve_and_upload_spec.rb
+++ b/spec/plans/util/retrieve_and_upload_spec.rb
@@ -5,7 +5,7 @@
include BoltSpec::Plans
it 'file needs downloaded and needs uploaded' do
- expect_task('peadm::os_identification')
+ allow_task('facts').be_called_times(1).with_targets('local://localhost').always_return({ 'os' => { 'family' => 'RedHat' } })
expect_command("test -e '/tmp/download'").error_with('kind' => 'nope', 'msg' => 'The command failed with exit code 1')
expect_task('peadm::download')
expect_task('peadm::filesize').be_called_times(2).return_for_targets(
diff --git a/tasks/os_identification.json b/tasks/os_identification.json
deleted file mode 100644
index 3b54dc87..00000000
--- a/tasks/os_identification.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "description": "Return the operating system runnin gon the target as a string",
- "parameters": { },
- "implementations": [
- {"name": "os_identification.sh", "requirements": ["shell"], "input_method": "environment"},
- {"name": "os_identification.ps1", "requirements": ["powershell"]}
- ]
- }
-
diff --git a/tasks/os_identification.ps1 b/tasks/os_identification.ps1
deleted file mode 100644
index f8bb39d7..00000000
--- a/tasks/os_identification.ps1
+++ /dev/null
@@ -1,18 +0,0 @@
-# os_identification.ps1
-try {
-
- $os = [System.Environment]::OSVersion.Platform
-
- if ($os -eq "Win32NT") {
- $osfamily = "windows"
- }elseif ($os -eq "Unix") {
- $osfamily = "unix"
- }else {
- $osfamily = "unknown"
- }
-
- return $osfamily
-}catch {
- Write-Host "Installer failed with Exception: $_.Exception.Message"
- Exit 1
-}
diff --git a/tasks/os_identification.sh b/tasks/os_identification.sh
deleted file mode 100644
index 3e80ac5e..00000000
--- a/tasks/os_identification.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-if [[ "$OSTYPE" == "linux-gnu"* ]]; then
- osfamily="linux"
-elif [[ "$OSTYPE" == "darwin"* ]]; then
- osfamily="macOS"
-elif [[ "$OSTYPE" == "cygwin" ]]; then
- osfamily="cygwin"
-elif [[ "$OSTYPE" == "msys" ]]; then
- osfamily="msys"
-elif [[ "$OSTYPE" == "win32" ]]; then
- osfamily="windows"
-elif [[ "$OSTYPE" == "freebsd"* ]]; then
- osfamily="freebsd"
-else
- osfamily="unknown"
-fi
-
- echo $osfamily