Merge "Add playbook to manage power state of ironic servers"
This commit is contained in:
commit
e4c0d38df7
16
playbooks/infracloud/manage_power.yml
Executable file
16
playbooks/infracloud/manage_power.yml
Executable file
@ -0,0 +1,16 @@
|
||||
# This playbook will allow to manage power state of the baremetal group
|
||||
# power_state setting needs to be passed, with on/off values
|
||||
# Following settings are available (can be passed with -e flag):
|
||||
# - target: group or host where to run the play. -etarget=baremetal will run
|
||||
# this play in all servers managed by bifrost.
|
||||
# - power_state: It will take off/on values, and will set the servers to
|
||||
# this power state.
|
||||
---
|
||||
- hosts: "{{ target }}"
|
||||
connection: local
|
||||
gather_facts: true
|
||||
tasks:
|
||||
- name: 'Manage power state of the given host'
|
||||
shell: "ironic node-set-power-state '{{ inventory_hostname }}' '{{ power_state }}'"
|
||||
failed_when: ( power_state != 'on' ) and ( power_state != 'off' )
|
||||
|
Loading…
Reference in New Issue
Block a user