diff --git a/README.md b/README.md index b55ced5..baf3bf7 100644 --- a/README.md +++ b/README.md @@ -10,20 +10,25 @@ Hostname: `icinga-dev` Provider: `VirtualBox` The following ports will be forwarded into the Vagrant box: -* 80 (guest) => 80 (host) -* 443 (guest) => 443 (host) // Webserver with TLS not configured via default -* 5665 (guest) => 5665 (host) -* 8086 (guest) => 8086 (host) +* Mysql: 3306 (guest) => 3306 (host) +* Webserver: 80 (guest) => 80 (host) +* Webserver: 443 (guest) => 443 (host) // Webserver with TLS not configured via default +* Icinga 2: 5665 (guest) => 5665 (host) +* InfluxDB: 8086 (guest) => 8086 (host) +* Grafana: 3000 (guest) => 3000 (host) +* Carbonapi: 8888 (guest) => 8888 (host) ## Credentials Default credentials if not customized (Format: `user` - `password`): -* Icinga Web 2 admin => `icinga` - `icinga` -* Icinga 2 API user => `poweruser` - `poweruser` +* Icinga Web 2 admin => `icinga` - `icinga` +* Icinga 2 API user => `poweruser` - `poweruser` * IcingaDB-redis password => `redis-pass` -* Mysql `*.*` user => `poweruser` - `poweruser` -* Mysql root user: `root` - `root0815!` -* InfluxDB admin user: `admin` - `admin12345!` +* Mysql `*.*` user => `poweruser` - `poweruser` +* Mysql root user => `root` - `root0815!` +* InfluxDB admin user => `admin` - `admin12345!` +* InfluxDB admin token => `AHDUKAGSszifgj21711sfztGASg2` +* Grafana initial user => `admin` - `admin` ## Components @@ -42,6 +47,8 @@ The most common used components are pre-installed and configured. * carbonapi * InfluxDB (Ansible collection `tbauriedel.influxdb2`) * InfluxDB v2 +* Grafana + * Grafana (Ansible collection `grafana.grafana`) ## Requirements diff --git a/Vagrantfile b/Vagrantfile index 7f5108d..bbbf4e3 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -13,4 +13,7 @@ Vagrant.configure("2") do |config| config.vm.network "forwarded_port", guest: 443, host: 443 config.vm.network "forwarded_port", guest: 5665, host: 5665 config.vm.network "forwarded_port", guest: 8086, host: 8086 + config.vm.network "forwarded_port", guest: 3000, host: 3000 + config.vm.network "forwarded_port", guest: 3306, host: 3306 + config.vm.network "forwarded_port", guest: 8888, host: 8888 end diff --git a/ansible/playbook.yml b/ansible/playbook.yml index afcda09..ac59074 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -2,6 +2,21 @@ - hosts: all gather_facts: true become: true + vars: + _enabled_roles: + - tbauriedel.gographite.gocarbon + - tbauriedel.gographite.carbonapi + - tbauriedel.influxdb2.repos + - tbauriedel.influxdb2.influxdb2 + - grafana.grafana.grafana + - geerlingguy.mysql + - icinga.icinga.repos + - icinga.icinga.icinga2 + - icinga.icinga.icingadb_redis + - icinga.icinga.icingadb + - icinga.icinga.icingaweb2 + - icinga.icinga.monitoring_plugins + pre_tasks: - name: Include vars ansible.builtin.include_vars: @@ -15,6 +30,12 @@ when: - ansible_os_family == "RedHat" - icinga_repo_subscription_username == "" or icinga_repo_subscription_password == "" + - "'icinga.icinga.repos' in _enabled_roles" + + tasks: + - ansible.builtin.include_role: + name: "{{ item }}" + loop: "{{ _enabled_roles }}" post_tasks: - name: Start / enable icinga-director @@ -22,23 +43,13 @@ name: icinga-director state: started enabled: true + when: "'icinga.icinga.icingaweb2' in _enabled_roles" - name: Start / enable httpd if needed ansible.builtin.systemd_service: name: httpd state: started enabled: true - when: ansible_os_family == "RedHat" - - roles: - - tbauriedel.gographite.gocarbon - - tbauriedel.gographite.carbonapi - - tbauriedel.influxdb2.repos - - tbauriedel.influxdb2.influxdb2 - - geerlingguy.mysql - - icinga.icinga.repos - - icinga.icinga.icinga2 - - icinga.icinga.icingadb_redis - - icinga.icinga.icingadb - - icinga.icinga.icingaweb2 - - icinga.icinga.monitoring_plugins + when: + - ansible_os_family == "RedHat" + - "'icinga.icinga.icingaweb2' in _enabled_roles" diff --git a/ansible/vars/grafana.yml b/ansible/vars/grafana.yml new file mode 100644 index 0000000..cb976d3 --- /dev/null +++ b/ansible/vars/grafana.yml @@ -0,0 +1,25 @@ +--- +grafana_security: + admin_user: admin + admin_password: admin + allow_embedding: true +grafana_auth: + anonymous: + enabled: true + org_role: Viewer + +grafana_datasources: + - name: "Local CarbonApi" + ds_type: graphite + ds_url: http://localhost:8888 + - name: "Local InfluxDB - Flux" + ds_type: influxdb + ds_url: http://localhost:8086 + additional_json_data: + version: "Flux" + organization: "monitoring" + defaultBucket: "icinga2" + tlsSkipVerify: false + additional_secure_json_data: + token: "AHDUKAGSszifgj21711sfztGASg2" + # Add "InfluxDB - InfluxQL" as datasource diff --git a/requirements.yml b/requirements.yml index 6930b88..c8e64b3 100644 --- a/requirements.yml +++ b/requirements.yml @@ -6,3 +6,5 @@ collections: - name: icinga.icinga - name: tbauriedel.gographite - name: tbauriedel.influxdb2 + - name: grafana.grafana + - name: community.grafana