---
# playbook for home02


- hosts: dkhost
  remote_user: ansible
  gather_facts: yes
  become: true

  vars:
#    datadog_api_key: ca0faf176c4aedd4f547ed7cf85615eb
#    datadog_config:
#      log_level: WARNING
#      apm_enabled: false
#    datadog_checks:
#      system:
#        init_config: []
#        instances: []
#      disk:
#        init_config:
#        instances:
#            - use_mount: yes
#              excluded_filesystems:
#                - sysfs
#                - cgroup
#                - tracefs
#                - debugfs
#                - proc
#                - securityfs
#                - tmpfs
#              excluded_mountpoint_re: /[media/richard|run/user].*

      docker:
        init_config:
        instances:
          - url: "unix://var/run/docker.sock"
            new_tag_names: true

      dockerhost:
        users:
          - dd-agent
          - richard
          - ansible

      nginx_remove_default_vhost: true
      nginx_vhosts_filename: "xai-corp.conf"
      nginx_vhosts:
        - listen: "80 default_server"
          server_name: "xai-corp.net"
          root: "/var/www/xai-corp.net"
          index: "index.html index.htm"
          access_log: "/var/log/nginx/xaicorp.access.log"
          error_log: "/var/log/nginx/xaicorp.error.log"

      gluster:
        vmshare:
          host: gluster:/vmshares
          mount: /opt/shared
        gitea:
          host: gluster:/gitea
          mount: /var/lib/gitea
        jenkins:
          host: gluster:/jenkins2
          mount: /var/lib/jenkins
        prometheus:
          host: gluster:/prometheus
          mount: /opt/prometheus
        nextcloud:
          host: gluster:/nextcloud
          mount: /opt/nextcloud
        mariadb:
          host: gluster:/mariadb
          mount: /opt/mariadb
        postgresql:
          host: gluster:/postgresql
          mount: /opt/postgresql
      gluster_remove:
        elasticsearch:
          host: gluster:/elasticsearch
          mount: /data/elasticsearch

      certbot:
        uninstall: true
        domains:
          - xai-corp.net
          - www.xai-corp.net
          - dkregistry.xai-corp.net
          - sql.xai-corp.net
          - fs.xai-corp.net
          - dkhost.xai-corp.net
          - git.xai-corp.net
          - dkui.xai-corp.net
          - jenkins.xai-corp.net
          - logs.xai-corp.net
          - tripbuilder.xai-corp.net
          - xaibox.xai-corp.net
          - office.xai-corp.net

  roles:
    - dockerhost
    - rsyslog
#    - geerlingguy.nginx
    #- certbot
#    - { role: Datadog.datadog, when: ansible_architecture != 'armv7l' } #does not support armhf architecture. should switch to fluentd or logstash


  post_tasks:
