cisco.intersight.intersight_server_profile_derive module – Derive Server Profiles from Templates in Cisco Intersight

Note

This module is part of the cisco.intersight collection (version 2.20.0).

You might already have this collection installed if you are using the ansible package. 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 cisco.intersight.

To use it in a playbook, specify: cisco.intersight.intersight_server_profile_derive.

Synopsis

  • Derive new Server Profiles from a Server Profile Template using the Intersight MoCloner API.

  • Sync existing derived profiles back to their template when the template has changed using the MoMerger API.

  • Idempotent - will not re-derive if the profile already exists, and will not sync if the profile is already in sync.

  • For more information see Cisco Intersight.

Parameters

Parameter

Comments

api_bearer_token

string

Bearer token for OAuth2 authentication with the Intersight API.

When provided, api_key_id and api_private_key are not required and the cryptography Python library is not needed.

If not set, the value of the INTERSIGHT_API_BEARER_TOKEN environment variable is used.

api_key_id

string

Public API Key ID associated with the private key.

If not set, the value of the INTERSIGHT_API_KEY_ID environment variable is used.

Required if api_bearer_token is not provided.

api_private_key

path

Filename (absolute path) or string of PEM formatted private key data to be used for Intersight API authentication.

If a string is used, Ansible vault should be used to encrypt string data.

Ex. ansible-vault encrypt_string --vault-id tme@/Users/dsoper/Documents/vault_password_file ‘-----BEGIN EC PRIVATE KEY-----

<your private key data>

-----END EC PRIVATE KEY-----’

If not set, the value of the INTERSIGHT_API_PRIVATE_KEY environment variable is used.

Required if api_bearer_token is not provided.

api_uri

string

URI used to access the Intersight API.

If not set, the value of the INTERSIGHT_API_URI environment variable is used.

Default: "https://intersight.com/api/v1"

force_sync

boolean

When true, always sync existing derived profiles to the template, even if the profile appears to be in sync.

When false, only sync profiles whose ConfigContext shows they are out of sync with the template.

Choices:

  • false ← (default)

  • true

organization

string

The name of the Organization this resource is assigned to.

Default: "default"

profile_names

list / elements=string / required

List of Server Profile names to derive from the template.

Each name must be unique within the organization.

state

string

If present, will derive profiles that do not exist and sync profiles that are out of sync with the template.

If absent, will delete derived profiles.

Choices:

  • "present" ← (default)

  • "absent"

template_name

string / required

Name of the Server Profile Template to derive from.

The template must exist in the specified organization.

use_proxy

boolean

If no, it will not use a proxy, even if one is defined in an environment variable on the target hosts.

Choices:

  • false

  • true ← (default)

validate_certs

boolean

Boolean control for verifying the api_uri TLS certificate

Choices:

  • false

  • true ← (default)

Examples

- name: Derive a single server profile from a template
  cisco.intersight.intersight_server_profile_derive:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: default
    template_name: My-Standard-Template
    profile_names:
      - SP-Derived-1

- name: Derive multiple server profiles from a template
  cisco.intersight.intersight_server_profile_derive:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: default
    template_name: My-Standard-Template
    profile_names:
      - SP-Derived-1
      - SP-Derived-2
      - SP-Derived-3

- name: Force sync derived profiles back to template
  cisco.intersight.intersight_server_profile_derive:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    template_name: My-Standard-Template
    profile_names:
      - SP-Derived-1
    force_sync: true

- name: Delete derived server profiles
  cisco.intersight.intersight_server_profile_derive:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    template_name: My-Standard-Template
    profile_names:
      - SP-Derived-1
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

api_response

dictionary

Summary of derive/sync operations performed.

Returned: always

Sample: {"api_response": {"deleted": [], "derived": ["SP-Derived-1", "SP-Derived-2"], "skipped": [], "synced": ["SP-Derived-3"]}}

Authors

  • Steve Fulmer (@stevefulme1)