---
- hosts: all
  roles:
    - role: common
    - role: thruk_developer
  tasks:
  - name: "omd config change"
    shell: "omd config demo change"
    args:
      stdin: |
        LIVESTATUS_TCP=on
        NAGFLUX=on
        INFLUXDB=on
        PNP4NAGIOS=off
        INFLUXDB_HTTP_TCP_PORT=:8086
  - copy:
      src: "/root/thruk_local.conf"
      dest: "/omd/sites/demo/etc/thruk/thruk_local.conf"
      owner: "demo"
      group: "demo"
  - name: copy naemon example.cfg
    copy:
      src: /omd/sites/demo/share/doc/naemon/example.cfg
      dest: /omd/sites/demo/etc/naemon/conf.d/example.cfg
      owner: demo
      group: demo
  - shell: sed -e "s/-pnp/-perf/g" -i /omd/sites/demo/etc/naemon/conf.d/example.cfg
  - copy:
      src: /root/1.tbp
      dest: /omd/sites/demo/etc/thruk/bp/
      owner: demo
      group: demo
  - name: "thruk bp commit"
    shell: sudo su - demo -c "thruk bp commit"
  - name: wait for ssh config to become available
    wait_for:
      path: /mnt/shared/.ssh
  - shell: sudo su - demo -c "cp -rp /mnt/shared/.ssh ."
