Showing with 24 additions and 50 deletions.
  1. +12 −0 CHANGELOG.md
  2. +0 −24 REFERENCE.md
  3. +0 −13 lib/puppet/functions/reboot/sleep.rb
  4. +7 −7 metadata.json
  5. +5 −6 plans/init.pp
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [v4.0.1](https://github.com/puppetlabs/puppetlabs-reboot/tree/v4.0.1) (2021-03-15)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-reboot/compare/v4.0.0...v4.0.1)

### Fixed

- Cleanup: Changed to ctrl::sleep\(\) and removed redundant reboot::sleep\(\) function [\#284](https://github.com/puppetlabs/puppetlabs-reboot/pull/284) ([fetzerms](https://github.com/fetzerms))
- \(MODULES-10955\) More robust handling of reboot-task output [\#280](https://github.com/puppetlabs/puppetlabs-reboot/pull/280) ([fetzerms](https://github.com/fetzerms))

## [v4.0.0](https://github.com/puppetlabs/puppetlabs-reboot/tree/v4.0.0) (2021-02-27)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-reboot/compare/v3.2.0...v4.0.0)

### Changed

- pdksync - \(MAINT\) Remove SLES 11 support [\#279](https://github.com/puppetlabs/puppetlabs-reboot/pull/279) ([sanfrancrisko](https://github.com/sanfrancrisko))
- pdksync - \(MAINT\) Remove RHEL 5 family support [\#278](https://github.com/puppetlabs/puppetlabs-reboot/pull/278) ([sanfrancrisko](https://github.com/sanfrancrisko))
- pdksync - Remove Puppet 5 from testing and bump minimal version to 6.0.0 [\#275](https://github.com/puppetlabs/puppetlabs-reboot/pull/275) ([carabasdaniel](https://github.com/carabasdaniel))

## [v3.2.0](https://github.com/puppetlabs/puppetlabs-reboot/tree/v3.2.0) (2021-01-19)
Expand Down Expand Up @@ -41,6 +52,7 @@ All notable changes to this project will be documented in this file. The format
### Added

- Add `shutdown\_only` parameter to tasks [\#224](https://github.com/puppetlabs/puppetlabs-reboot/pull/224) ([MikaelSmith](https://github.com/MikaelSmith))
- \(MODULES-8201\) Add pending reboot due to domain join for windows. [\#179](https://github.com/puppetlabs/puppetlabs-reboot/pull/179) ([razorbladex401](https://github.com/razorbladex401))

## [v2.3.0](https://github.com/puppetlabs/puppetlabs-reboot/tree/v2.3.0) (2019-12-06)

Expand Down
24 changes: 0 additions & 24 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

* [`reboot`](#reboot)

### Functions

* [`reboot::sleep`](#rebootsleep): Sleeps for specified number of seconds.

### Tasks

* [`init`](#init): Reboots a machine
Expand Down Expand Up @@ -104,26 +100,6 @@ Default value: `60`

For pending reboots, ignore the supplied reasons when checking pennding reboot

## Functions

### <a name="rebootsleep"></a>`reboot::sleep`

Type: Ruby 4.x API

Sleeps for specified number of seconds.

#### `reboot::sleep(Integer $period)`

Sleeps for specified number of seconds.

Returns: `Any`

##### `period`

Data type: `Integer`

Time to sleep (in seconds)

## Tasks

### <a name="init"></a>`init`
Expand Down
13 changes: 0 additions & 13 deletions lib/puppet/functions/reboot/sleep.rb

This file was deleted.

14 changes: 7 additions & 7 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-reboot",
"version": "4.0.0",
"version": "4.0.1",
"author": "puppetlabs",
"summary": "Adds a type and provider for managing system reboots.",
"license": "Apache-2.0",
Expand All @@ -14,12 +14,12 @@
{
"operatingsystem": "Windows",
"operatingsystemrelease": [
"Server 2008",
"Server 2008 R2",
"Server 2012",
"Server 2012 R2",
"Server 2016",
"Server 2019",
"2008",
"2008 R2",
"2012",
"2012 R2",
"2016",
"2019",
"7",
"8",
"10"
Expand Down
11 changes: 5 additions & 6 deletions plans/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
}

# Reboot; catch errors here because the connection may get cut out from underneath
$reboot_result = run_task('reboot', $targets, timeout => $reboot_delay, message => $message)
run_task('reboot', $targets, timeout => $reboot_delay, message => $message)

# Wait long enough for all targets to trigger reboot, plus disconnect_wait to allow for shutdown time.
$timeouts = $reboot_result.map |$result| { $result['timeout'] }
$wait = max($timeouts)
reboot::sleep($wait+$disconnect_wait)
# Use $reboot_delay as wait time, but at least 3s
$wait = max(3, $reboot_delay)
ctrl::sleep($wait+$disconnect_wait)

$start_time = Timestamp()
# Wait for reboot in a loop
Expand Down Expand Up @@ -76,7 +75,7 @@
if !$failed_targets.empty() and !$timed_out {
# sleep for a small time before trying again
reboot::sleep($retry_interval)
ctrl::sleep($retry_interval)
# wait for all targets to be available again
$remaining_time = $reconnect_timeout - $elapsed_time_sec
Expand Down