Split Influx 1 and 2 setup. 1 works with grafana very easily. 2 must not be implemented well yet.
This commit is contained in:
		
							
								
								
									
										3
									
								
								hosts
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								hosts
									
									
									
									
									
								
							| @@ -44,5 +44,4 @@ x570 amdgpu=true nanominer=true nanominer_gpu=eth nanominer_gpus=0 nanominer_gpu | |||||||
| ;                Example: true | ;                Example: true | ||||||
| ; | ; | ||||||
| office  domain=hyperling.com onlyoffice=true | office  domain=hyperling.com onlyoffice=true | ||||||
| grafana domain=hyperling.com grafana=true influxdb=true | grafana domain=hyperling.com grafana=true influxdb1=true | ||||||
| test influxdb=true telegraf=true grafana=true |  | ||||||
| @@ -122,12 +122,15 @@ | |||||||
|     - include: tasks/server/onlyoffice.yml |     - include: tasks/server/onlyoffice.yml | ||||||
|       when: onlyoffice is defined and ansible_pkg_mgr == "apt" |       when: onlyoffice is defined and ansible_pkg_mgr == "apt" | ||||||
|  |  | ||||||
|  |     - include: tasks/server/influxdb1.yml | ||||||
|  |       when: influxdb1 is defined and ansible_pkg_mgr == "apt" | ||||||
|  |  | ||||||
|  |     - include: tasks/server/influxdb2.yml | ||||||
|  |       when: influxdb2 is defined and ansible_pkg_mgr == "apt" | ||||||
|  |  | ||||||
|     - include: tasks/server/grafana.yml |     - include: tasks/server/grafana.yml | ||||||
|       when: grafana is defined and ansible_pkg_mgr == "apt" |       when: grafana is defined and ansible_pkg_mgr == "apt" | ||||||
|  |  | ||||||
|     - include: tasks/server/influxdb.yml |  | ||||||
|       when: influxdb is defined and ansible_pkg_mgr == "apt" |  | ||||||
|  |  | ||||||
|     - include: tasks/server/telegraf.yml |     - include: tasks/server/telegraf.yml | ||||||
|       when: telegraf is defined and ansible_pkg_mgr == "apt" |       when: telegraf is defined and ansible_pkg_mgr == "apt" | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| --- | --- | ||||||
| # Application that populates InfluxDB with metric data. | # InfluxDB 1.* to be used with Grafana. | ||||||
| 
 | 
 | ||||||
| - name: Server | InfluxDB | Check | - name: Server | InfluxDB | Check | ||||||
|   shell: which influxd |   shell: which influxd | ||||||
| @@ -11,10 +11,16 @@ | |||||||
|   args: |   args: | ||||||
|     chdir: "{{ ansible_env.HOME }}/Downloads/" |     chdir: "{{ ansible_env.HOME }}/Downloads/" | ||||||
|   loop: |   loop: | ||||||
|     - mv influxdb2-2.0.4-amd64.deb ~/TRASH/ 2>/dev/null; exit 0 |  | ||||||
|     - mv influxdb_1.8.4_amd64.deb ~/TRASH/ 2>/dev/null; exit 0 |     - mv influxdb_1.8.4_amd64.deb ~/TRASH/ 2>/dev/null; exit 0 | ||||||
|     - wget https://dl.influxdata.com/influxdb/releases/influxdb_1.8.4_amd64.deb |     - wget https://dl.influxdata.com/influxdb/releases/influxdb_1.8.4_amd64.deb | ||||||
|     - sudo dpkg -i influxdb_1.8.4_amd64.deb |     - sudo dpkg -i influxdb_1.8.4_amd64.deb | ||||||
|     - service influxdb start |     - service influxdb start | ||||||
|     - influx setup -f -u ling -p initpassword -o Hyperling -b main -r 0 |     - sleep 10 | ||||||
|   when: influxdb_check.failed |   when: influxdb_check.failed | ||||||
|  | 
 | ||||||
|  | - name: Server | InfluxDB | Config | ||||||
|  |   shell: "{{ item }}" | ||||||
|  |   loop: | ||||||
|  |     - influx -execute "create database main" | ||||||
|  |     - influx -execute "show databases" | ||||||
|  |     - influx -database main -execute "INSERT cpu,host=success,region=test value=1.00" | ||||||
							
								
								
									
										24
									
								
								tasks/server/influxdb2.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								tasks/server/influxdb2.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | |||||||
|  | --- | ||||||
|  | # Create an Influx2.0 DB. Have not successfully used in Grafana yet. | ||||||
|  |  | ||||||
|  | - name: Server | InfluxDB | Check | ||||||
|  |   shell: which influxd | ||||||
|  |   register: influxdb_check | ||||||
|  |   ignore_errors: yes | ||||||
|  |  | ||||||
|  | - name: Server | InfluxDB | Install | ||||||
|  |   shell: "{{ item }}" | ||||||
|  |   args: | ||||||
|  |     chdir: "{{ ansible_env.HOME }}/Downloads/" | ||||||
|  |   loop: | ||||||
|  |     - mv influxdb2-2.0.4-amd64.deb ~/TRASH/ 2>/dev/null; exit 0 | ||||||
|  |     - wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.4-amd64.deb | ||||||
|  |     - sudo dpkg -i influxdb2-2.0.4-amd64.deb | ||||||
|  |     - service influxdb start | ||||||
|  |     - sleep 10 | ||||||
|  |   when: influxdb_check.failed | ||||||
|  |  | ||||||
|  | - name: Server | InfluxDB | Config | ||||||
|  |   shell: "{{ item }}" | ||||||
|  |   loop: | ||||||
|  |     - influx setup -f -u ling -p initpassword -o Hyperling -b main -r 0 | ||||||
		Reference in New Issue
	
	Block a user