--- # # For use with the CiscoUcs.ucs role published to Ansible Galaxy: # https://galaxy.ansible.com/list#/roles?autocomplete=ucs # # Several examples provided below. Customize for your desired configuration as needed. # # Example 1: Complete UCS config using defaults/main.yml values from all subdirs in the role - hosts: "{{ target | default('ucs') }}" connection: local gather_facts: no tasks: - set_fact: ucs_hostname: "{{ ansible_host }}" when: ucs_hostname is not defined - import_role: name: CiscoUcs.ucs # Example 2: LAN config only using defaults/main.yml values in all lan subdirs for the role - hosts: "{{ target | default('ucs') }}" connection: local gather_facts: no tasks: - set_fact: ucs_hostname: "{{ ansible_host }}" when: ucs_hostname is not defined - import_role: name: CiscoUcs.ucs/lan tags: [ 'never', 'lan' ] # Example 3: VLAN config only from the lan/vlans subdir of the role. ucs_vlans variables specified directly in the playbook - hosts: "{{ target | default('ucs') }}" connection: local gather_facts: no tasks: - set_fact: ucs_hostname: "{{ ansible_host }}" when: ucs_hostname is not defined - import_role: name: CiscoUcs.ucs/lan/vlans vars: ucs_vlans: - name: Native-VLAN id: '2' native: 'no' tags: [ 'never', 'vlan' ]