stephrobert.scaleway.power_schedule role – Bring a named inventory group to a power state

Note

This role is part of the stephrobert.scaleway collection (version 0.7.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it use: ansible-galaxy collection install stephrobert.scaleway.

To use it in a playbook, specify: stephrobert.scaleway.power_schedule.

Entry point main – Bring a named inventory group to a power state

Synopsis

  • Reads each machine of the group first, then acts only on those not already where they should be. The action module is a trigger and not a state, so idempotence lives here rather than in the module.

  • Machines in a transient state are named and left alone. A machine that could not be read fails the run, because a power state nobody could read is not a power state that is fine.

Parameters

Parameter

Comments

scaleway_power_schedule_desired_state

string

on or off. Required as soon as a group is named.

It is validated by the role rather than by choices, so that the refusal carries the sentence that explains it.

Default: ""

scaleway_power_schedule_group

string

The inventory group to act on. Empty means do nothing and say so.

There is no default target, because a schedule that guesses which machines to power off is how a fleet goes down one evening.

Default: ""

scaleway_power_schedule_selector

dictionary

What to act on, said the same way everywhere: exactly one of group, name or tags, plus match set to all or any when several tags are given.

all is the default, because it is the narrower selection: for an operation that writes, erring on the safe side means touching fewer machines, never more.

An ambiguous name is refused rather than settled, and an unknown key is refused rather than selecting nothing, because a typo and an empty fleet look alike.

Default: {}