mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Cisco Intersight module_utils and intersight_facts module (#51309)
* Cisco Intersight module_utils and intersight_facts module * Add RETURN information and fix pylint, import, and pep8 issues. * Review updates for specifying type of params/returns and not polluting ansible_facts. * BSD one line license, validate_certs used, urls.fetch_urls replaces requests
This commit is contained in:
3
test/integration/targets/intersight_facts/aliases
Normal file
3
test/integration/targets/intersight_facts/aliases
Normal file
@@ -0,0 +1,3 @@
|
||||
# Not enabled, but can be used with Intersight by specifying API keys.
|
||||
# See tasks/main.yml for examples.
|
||||
unsupported
|
||||
37
test/integration/targets/intersight_facts/tasks/main.yml
Normal file
37
test/integration/targets/intersight_facts/tasks/main.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
# Test code for the Cisco Intersight modules
|
||||
# Copyright 2019, David Soper (@dsoper2)
|
||||
|
||||
- name: Setup API access variables
|
||||
debug: msg="Setup API keys"
|
||||
vars:
|
||||
api_info: &api_info
|
||||
api_private_key: "{{ api_private_key | default('~/Downloads/SSOSecretKey.txt') }}"
|
||||
api_key_id: "{{ api_key_id | default('596cc79e5d91b400010d15ad/596cc7945d91b400010d154e/5b6275df3437357030a7795f') }}"
|
||||
|
||||
- name: Get facts for all servers
|
||||
intersight_facts:
|
||||
<<: *api_info
|
||||
server_names:
|
||||
register: result
|
||||
|
||||
- name: Verify facts does not report a change
|
||||
assert:
|
||||
that:
|
||||
- result.changed == false
|
||||
- "'Name' in result.intersight_servers[0]"
|
||||
- "'Moid' in result.intersight_servers[0]"
|
||||
|
||||
- name: Get facts for servers by name
|
||||
intersight_facts:
|
||||
<<: *api_info
|
||||
server_names:
|
||||
- CC7UCS-13-1-1
|
||||
register: result2
|
||||
|
||||
- name: Verify facts does not report a change
|
||||
assert:
|
||||
that:
|
||||
- result2.changed == false
|
||||
- "'Name' in result2.intersight_servers[0]"
|
||||
- "'Moid' in result2.intersight_servers[0]"
|
||||
Reference in New Issue
Block a user