11-09-2023 07:05 AM
trying to create domain vlan/vsan policy but keep failing. any idea? I think i need to assign a multicast policy to it? or resource path is wrong?
02-02-2024 03:45 PM
got this working but need help with the loop:
02-03-2024 06:36 AM
any idea why this is not working. I keep getting "msg": "API error: (400, 'HTTP Error 400: Bad Request',
- name: "Configure VSAN Policies"
vars:
api_info: &api_info
api_private_key: "{{ api_private_key }}"
api_key_id: "{{ api_key_id }}"
api_uri: "{{ api_uri | default(omit) }}"
validate_certs: "{{ validate_certs | default(omit) }}"
state: "{{ state | default(omit) }}"
cisco.intersight.intersight_rest_api:
<<: *api_info
resource_path: /fabric/FcNetworkPolicies
query_params:
$filter: "Name eq '{{ item.name }}'"
api_body:
Name: "{{ item.name }}"
Description: "{{ item.description }}"
Organization:
Moid: "{{ intersight_org.api_response.Moid }}"
Tags:
- Key: "configmode"
Value: "ansible"
- Key: "prefix"
Value: ""
register: vsan_policy_result
loop:
- { name: "{{ name_of_vsan_policy_A }}", description: "{{ description_of_vsan_policy_A }}" }
- { name: "{{ name_of_vsan_policy_B }}", description: "{{ description_of_vsan_policy_B }}" }
- name: Print return information
ansible.builtin.debug:
var: item.api_response.Moid
loop: "{{ vsan_policy_result.results }}"
- name: "Get Moid for Domain VSAN Policy"
cisco.intersight.intersight_rest_api:
<<: *api_info
resource_path: /fabric/FcNetworkPolicies
query_params:
$filter: "Name eq '{{ name_of_vsan_policy_A }}'"
register: vsan_policy_A
# Get Org Info
- name: "Get Organization Info"
intersight_rest_api:
<<: *api_info
resource_path: /organization/Organizations
query_params:
$filter: "Name eq 'default'"
return_list: true
register: org_info
- name: Print return information from the previous task
ansible.builtin.debug:
var: org_info.api_response[0].Moid
- name: "Create VSANs for VSAN Policy"
cisco.intersight.intersight_rest_api:
<<: *api_info
resource_path: "/bulk/Requests"
api_body: |
{
"Verb": "POST",
"Uri": "/v1/fabric/Vsans",
"Requests": [
{% for vsan in vsan_configs_A %}
{
"ObjectType": "bulk.RestSubRequest",
"Body": {
"Name": "{{ vsan.name }}",
"VsanId": "{{ vsan.vsan_id }}",
"FcoeVlan": "{{ vsan.fcoe_vsan_id }}",
"Scope": "Uplink",
"FcNetworkPolicy": "{{ vsan_policy_A.api_response.Moid }}"
}
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}
register: bulk_vsan_info
# Add a debug task to print information from the creation of VSANs
- name: Debug VSAN creation result
ansible.builtin.debug:
var: bulk_vsan_info
02-07-2024 09:12 AM
"Scope" parameter is incorrect. It should be "VsanScope": "Uplink"
02-07-2024 06:08 PM
Hi Sandeep,
any examples for SNMP, termal, power?
02-20-2024 09:43 AM
Hi Sandeep,
any examples for SNMP, switch control, port config policy?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide