---
- hosts:      localhost
  connection: local
  become:     true
  vars_files:
    - vars/default-core.yml

  tasks:
    - name: Checking gsdl3servlet_external.protocol is set to 'https'
      debug: var=gsdl3servlet_external.protocol
      
    - command: echo "gsdl3servlet_external.prototol = {{ gsdl3servlet_external.protocol }}"
      failed_when: gsdl3servlet_external.protocol != "https"
      
    #
    # Apache2 https setup
    #
    - include_tasks: reverse-proxy-https-tasks.yml
      when: apache2_revproxy_config.https_port is defined

  handlers:
    - name: Reload Apache
      service:
        name: apache2
        state: reloaded

    - name: Restart Apache
      service:
        name: apache2
        state: restarted
