blob: 87e453a633860bad70a0517a63c8ca257b20c16f (
plain)
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
|
# Test code for the UCS Query module
# Copyright 2019, John McDonough (@movinalot)
- name: Test that we have a UCS host, UCS username, and UCS password
fail:
msg: 'Please define the following variables: ucs_hostname, ucs_username and ucs_password.'
when: ucs_hostname is not defined or ucs_username is not defined or ucs_password is not defined
vars:
login_info: &login_info
<<: *login_info
# Query for Class ID
- name: Query Class ID
ucs_query:
<<: *login_info
class_ids: computeBlade
delegate_to: localhost
register: single_class
# Query for Class IDs
- name: Query Class IDs
ucs_query:
<<: *login_info
class_ids: computeBlade, fabricVlan
delegate_to: localhost
register: multiple_classes
# Query for Dn
- name: Query Dn
ucs_query:
<<: *login_info
distinguished_names: org-root
delegate_to: localhost
register: single_dn
# Query for Dn
- name: Query Dns
ucs_query:
<<: *login_info
distinguished_names: org-root, sys/rack-unit-1, sys/chassis-1/blade-2
delegate_to: localhost
register: multiple_dns
|