-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathadhoc-seamicro-poweron.yml
57 lines (47 loc) · 1.73 KB
/
adhoc-seamicro-poweron.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
# This ad-hoc playbook is written only to support Seamicro Chassis (now dead product)
# It uses some variables like user/pass to access Chassis rest API and configure/reset compute nodes
# By default, for CI purposes we are ensuring that we add a second path to chassis/fabric to present multipath and so increase available bandwdith during tests
- hosts: seamicro-nodes
gather_facts: False
become: True
# Some pre-defined list that will be added for 'uri' module and converted to json for rest api
vars:
seamicro_add_disk_body:
value: "{{ seamicro_diskid }}"
readonly: false
username: "{{ seamicro_chassis_user }}"
password: "{{ seamicro_chassis_pass }}"
seamicro_reset_body:
action: reset
using-pxe: "false"
username: "{{ seamicro_chassis_user }}"
password: "{{ seamicro_chassis_pass }}"
seamicro_poweroff_body:
action: power-off
force: "true"
username: "{{ seamicro_chassis_user }}"
password: "{{ seamicro_chassis_pass }}"
seamicro_poweron_body:
action: power-on
force: "true"
username: "{{ seamicro_chassis_user }}"
password: "{{ seamicro_chassis_pass }}"
tasks:
- block:
- name: Powering on the Seamicro node[s]
uri:
url: "https://{{ seamicro_chassis }}.ci.centos.org/v2.0/server/{{ seamicro_srvid }}"
validate_certs: no
method: POST
body_format: json
body: "{{ seamicro_reset_body | to_json }}"
timeout: 180
tags:
- reset
- name: Waiting for Seamicro node[s] to be available through ssh
wait_for:
port: 22
host: "{{ inventory_hostname }}"
timeout: 1200
delegate_to: "{{ deploy_host }}"