Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error handling for a ucs_vnic_template module playbook #132

Open
vivekanand552 opened this issue Jul 8, 2020 · 1 comment
Open

error handling for a ucs_vnic_template module playbook #132

vivekanand552 opened this issue Jul 8, 2020 · 1 comment

Comments

@vivekanand552
Copy link

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-B

    mac_pool: mac-b

    pin_group: lan-fab-14

    template_type: updating-template
    vlans_list:
    - name: vlan_241_vivek
      native: 'no'
    - name: vlan_viv
      native: 'no'
    - name: Container-MGMT-VLAN
      native: 'no'
    
    register: find_output

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

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.

Regards
Vivekanand
cisco ucs warning while adding vlan to vnic template

@vivekanand552
Copy link
Author

Hello All,

can anyone provide a error handling mechanism for the ucs_vnic_template module?

any help is highly appreciated.

Regards
Vivekanand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant