---
- name: Manage radius_server_sequence on ISE
  hosts: ise_servers
  gather_facts: false
  tasks:
    # - name: Get all
    #   cisco.ise.radius_server_sequence_info:
    #     ise_hostname: "{{ ise_hostname }}"
    #     ise_username: "{{ ise_username }}"
    #     ise_password: "{{ ise_password }}"
    #     ise_verify: "{{ ise_verify }}"
    #   register: result

    # - name: Print all
    #   ansible.builtin.debug:
    #     var: result

    # - name: Get by id
    #   cisco.ise.radius_server_sequence_info:
    #     ise_hostname: "{{ ise_hostname }}"
    #     ise_username: "{{ ise_username }}"
    #     ise_password: "{{ ise_password }}"
    #     ise_verify: "{{ ise_verify }}"
    #     id: d704e911-a916-11eb-8830-2ec507028ea8
    #   register: result

    - name: Create or update an radius_server_sequence
      cisco.ise.radius_server_sequence:
        ise_hostname: "{{ ise_hostname }}"
        ise_username: "{{ ise_username }}"
        ise_password: "{{ ise_password }}"
        ise_verify: "{{ ise_verify }}"
        state: present
        name: TESTSeq
        description: TESTSequence
        stripPrefix: false
        stripSuffix: false
        prefixSeparator: \
        suffixSeparator: "@"
        remoteAccounting: true
        localAccounting: false
        useAttrSetOnRequest: false
        useAttrSetBeforeAcc: false
        continueAuthorzPolicy: false
        RadiusServerList:
          - externalRadiusServer1
        OnRequestAttrManipulatorList: []
        BeforeAcceptAttrManipulatorsList: []
      register: result

    - name: Print result
      ansible.builtin.debug:
        var: result
