# Test code for the ACI modules # Copyright 2017, Jacob McGill 1 - query_all.existing.0.vzSubj is defined - '"class/vzSubj.json" in query_all.url' - name: delete subject - check mode works aci_contract_subject: &aci_subject_absent <<: *aci_subject_present state: absent check_mode: yes register: subject_absent_check_mode - name: delete subject - deletion works aci_contract_subject: <<: *aci_subject_absent register: subject_absent - name: delete subject - idempotency works aci_contract_subject: <<: *aci_subject_absent register: subject_absent_idempotent - name: delete subject - cleanup aci_contract_subject: <<: *aci_subject_present_2 state: absent - name: missing params - failure message works aci_contract_subject: <<: *aci_subject_absent subject: "{{ fakevar | default(omit) }}" ignore_errors: yes register: absent_missing_param - name: absent assertions assert: that: - subject_absent_check_mode.changed == true - subject_absent_check_mode.existing != [] - subject_absent_check_mode.proposed == {} - subject_absent.changed == true - subject_absent.existing == subject_absent_check_mode.existing - subject_absent_idempotent.changed == false - subject_absent_idempotent.existing == [] - absent_missing_param.failed == true - 'absent_missing_param.msg == "state is absent but the following are missing: subject"' - name: cleanup contract aci_contract: <<: *aci_contract_present state: absent when: contract_present.changed == true - name: cleanup tenant aci_tenant: <<: *aci_tenant_present state: absent when: tenant_present.changed == true