-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Hello All,
I am currently trying to automate my ucs environment using ucs modules and playbooks.
I am trying to add an error handling section while adding vlans to vnic template section, I am using failed module and failed when module but somehow its not working as expected, can you guys kindly help
playbook as given below
- name: Conigure the vnic template
ucs_vnic_template:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: "{{ ucs_state }}"
name: test
fabric: A-Bmac_pool: mac-b
pin_group: lan-fab-14
register: find_outputtemplate_type: updating-template vlans_list: - name: vlan_241_vivek native: 'no' - name: vlan_viv native: 'no' - name: Container-MGMT-VLAN native: 'no'
failed_when: find_output.changed
failed_when: "'Configuration Failure' in find_output.stdout"
- debug:
var: "{{find_output.stdout}}"
- name: warning for any potential failure scenario
fail:
msg: 'Multiple Uplink ports carrying overlapping disjoint vlans which may cause traffic disruption.'
ignore_errors: yes
with_items: '{{ service_profiles }}'
when: item is not in service_profiles
vars:
# use "<<: *login_info" to substite the information below in each task
# # this is not required, however it makes the playbook shorter.
# login_info: &login_info
# hostname: "{{ ucs_hostname }}"
# username: "{{ ucs_username }}"
# password: "{{ ucs_password }}"
allowed_SP:- Service Profile c4-blade1
service_profiles: - Service Profile test-SP1
- Service Profile test-SP2
- Service Profile c4-blade1
- Service Profile c4-blade1
I have also attached the warning message which i am trying to integrate to the playbook.
maybe i am doing something wrong, if somebody can kindly help me it would great.
Metadata
Metadata
Assignees
Labels
No labels