---
- hosts: all
  roles:
    - role: common
    - role: local_tests
    - role: thruk_developer
    - role: sendmail
  tasks:
  - name: "omd config change"
    shell: "omd config demo change"
    args:
      stdin: |
        APACHE_MODE=own
        LIVESTATUS_TCP=on
  - shell: rm /omd/sites/demo/etc/naemon/conf.d/*.cfg
  - shell: ln -s /thruk/support/thruk_templates.cfg /omd/sites/demo/etc/naemon/conf.d/thruk_templates.cfg
  - copy:
      src: /root/test.cfg
      dest: /omd/sites/demo/etc/naemon/conf.d/test.cfg
      owner: demo
      group: demo
  - copy:
      src: "{{ item }}"
      dest: /omd/sites/demo/var/thruk/reports/
      owner: demo
      group: demo
    with_items:
      - /root/1.rpt
      - /root/2.rpt
      - /root/3.rpt
      - /root/4.rpt
  - shell: sudo su - demo -c "htpasswd -b etc/htpasswd test_contact test"
  - shell: sudo su - demo -c "mkdir -p etc/thruk/templates/reports"
  - shell: sudo su - demo -c "ln -sfn /test/formlist_report.tt etc/thruk/templates/reports/formlist_report.tt"
