---
- name: Manage portal theme on ISE
  hosts: ise_servers
  gather_facts: false
  tasks:
    - name: Get portal_theme
      cisco.ise.portal_theme_info:
        ise_hostname: "{{ ise_hostname }}"
        ise_username: "{{ ise_username }}"
        ise_password: "{{ ise_password }}"
        ise_verify: "{{ ise_verify }}"
        id: 9eb58150-8c01-11e6-996c-525400b48521
      register: portal_theme

    - name: Print portal_theme id
      ansible.builtin.debug:
        var: portal_theme['ise_response']

    - name: Update portal_theme
      cisco.ise.portal_theme:
        ise_hostname: "{{ ise_hostname }}"
        ise_username: "{{ ise_username }}"
        ise_password: "{{ ise_password }}"
        ise_verify: "{{ ise_verify }}"
        state: present
        name: Custom Olive theme
        themeData: olive
      register: result

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