---

# MLAG State Tests

- name: Gather mlag status
  eos_command:
    commands: "show mlag detail | json"
  register: mlag_state
  tags:
    - mlag

- name: Validate mlag status
  assert:
    that:
      - mlag_state.stdout[0].state == 'active'
      - mlag_state.stdout[0].negStatus == 'connected'
    fail_msg: "State: {{ mlag_state.stdout[0].state| replace('\"','')  }} - negotiation_status: {{ mlag_state.stdout[0].negStatus| replace('\"','')  }}"
    quiet: true
  ignore_errors: "{{ eos_validate_state_validation_mode_loose }}"
  register: mlag_state_results
  tags:
    - mlag
