---
- hosts: all
  roles:
    - role: common
    - role: thruk_developer
  tasks:
  - name: "omd config change"
    shell: "omd config demo change"
    args:
      stdin: |
        APACHE_MODE=own
        CORE=none
        PNP4NAGIOS=off
  - shell: echo "testkey" > /omd/sites/demo/var/thruk/secret.key
  - file:
      path: /omd/sites/demo/var/thruk/secret.key
      mode: 0600
      owner: demo
      group: demo
  - copy:
      src: /root/thruk_local.conf
      dest: /omd/sites/demo/etc/thruk/thruk_local.conf
      owner: demo
      group: demo
  - name: "wait for backend to come up"
    uri:
      url: "http://backend/demo/thruk/cgi-bin/remote.cgi"
      validate_certs: False
      status_code: 200
    register: result
    until: result.status == 200
    retries: 180
    delay: 1
  - include_role:
      name: thruk_logcache_mysql
