Skip to content

Commit

Permalink
tasks: replace os_identification with facts
Browse files Browse the repository at this point in the history
the facts task is vendored into bolt. It supports gathering facts from
systems with and without facter installed.
  • Loading branch information
bastelfreak committed Nov 1, 2024
1 parent 6bac026 commit e244866
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 54 deletions.
7 changes: 0 additions & 7 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,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
Expand Down Expand Up @@ -1298,12 +1297,6 @@ Data type: `String`

New path of file

### <a name="os_identification"></a>`os_identification`

Return the operating system runnin gon the target as a string

**Supports noop?** false

### <a name="pe_install"></a>`pe_install`

Install Puppet Enterprise from a tarball
Expand Down
4 changes: 2 additions & 2 deletions plans/util/retrieve_and_upload.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion spec/plans/util/retrieve_and_upload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
9 changes: 0 additions & 9 deletions tasks/os_identification.json

This file was deleted.

18 changes: 0 additions & 18 deletions tasks/os_identification.ps1

This file was deleted.

17 changes: 0 additions & 17 deletions tasks/os_identification.sh

This file was deleted.

0 comments on commit e244866

Please sign in to comment.