Skip to content

Commit 1f49087

Browse files
committed
tasks: replace os_identification with facts
the facts task is vendored into bolt. It supports gathering facts from systems with and without facter installed.
1 parent 6bac026 commit 1f49087

7 files changed

+7
-54
lines changed

Diff for: REFERENCE.md

-7
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
* [`infrastatus`](#infrastatus): Runs puppet infra status and returns the output
7373
* [`mkdir_p_file`](#mkdir_p_file): Create a file with the specified content at the specified location
7474
* [`mv`](#mv): Wrapper task for mv command
75-
* [`os_identification`](#os_identification): Return the operating system runnin gon the target as a string
7675
* [`pe_install`](#pe_install): Install Puppet Enterprise from a tarball
7776
* [`pe_ldap_config`](#pe_ldap_config): Set the ldap config in the PE console
7877
* [`pe_uninstall`](#pe_uninstall): Uninstall Puppet Enterprise
@@ -1298,12 +1297,6 @@ Data type: `String`
12981297

12991298
New path of file
13001299

1301-
### <a name="os_identification"></a>`os_identification`
1302-
1303-
Return the operating system runnin gon the target as a string
1304-
1305-
**Supports noop?** false
1306-
13071300
### <a name="pe_install"></a>`pe_install`
13081301

13091302
Install Puppet Enterprise from a tarball

Diff for: metadata.json

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
{
3636
"name": "puppetlabs/ruby_task_helper",
3737
"version_requirement": ">= 0.6.1 < 1.0.0"
38+
},
39+
{
40+
"name": "puppetlabs/facts",
41+
"version_requirement": ">= 1.6.0 < 2.0.0"
3842
}
3943
],
4044
"operatingsystem_support": [

Diff for: plans/util/retrieve_and_upload.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
|-HEREDOC
3030
# lint:endignore
3131

32-
$operating_system = run_task('peadm::os_identification', 'local://localhost')
33-
$os_string =$operating_system.first.value['_output']
32+
$operating_system = run_task('facts', 'local://localhost')
33+
$os_string =$operating_system.first.value['os']['family']
3434

3535
if 'windows' in $os_string {
3636
$exists = run_command("[System.IO.File]::Exists('${local_path}')", 'local://localhost')

Diff for: spec/plans/util/retrieve_and_upload_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
include BoltSpec::Plans
66

77
it 'file needs downloaded and needs uploaded' do
8-
expect_task('peadm::os_identification')
8+
allow_task('facts').be_called_times(1).with_targets('local://localhost').always_return({ 'os' => { 'family' => 'RedHat' } })
99
expect_command("test -e '/tmp/download'").error_with('kind' => 'nope', 'msg' => 'The command failed with exit code 1')
1010
expect_task('peadm::download')
1111
expect_task('peadm::filesize').be_called_times(2).return_for_targets(

Diff for: tasks/os_identification.json

-9
This file was deleted.

Diff for: tasks/os_identification.ps1

-18
This file was deleted.

Diff for: tasks/os_identification.sh

-17
This file was deleted.

0 commit comments

Comments
 (0)