Add influxdb to ansible
This commit is contained in:
		
							parent
							
								
									96fd62dc3d
								
							
						
					
					
						commit
						2500d672fb
					
				
					 12 changed files with 102 additions and 87 deletions
				
			
		| 
						 | 
				
			
			@ -9,6 +9,7 @@
 | 
			
		|||
  roles:
 | 
			
		||||
    - acme-dns
 | 
			
		||||
    - gitea
 | 
			
		||||
    - influxdb
 | 
			
		||||
    - umami
 | 
			
		||||
    - watchtower
 | 
			
		||||
    - wiki-js
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,6 +4,7 @@
 | 
			
		|||
  roles:
 | 
			
		||||
    - acme-dns
 | 
			
		||||
    - gitea
 | 
			
		||||
    - influxdb
 | 
			
		||||
    - umami
 | 
			
		||||
    - watchtower
 | 
			
		||||
    - wiki-js
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										17
									
								
								_ansible/roles/influxdb/tasks/main.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								_ansible/roles/influxdb/tasks/main.yml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
---
 | 
			
		||||
- name: Deploy {{ svc.name }}
 | 
			
		||||
  tags:
 | 
			
		||||
    - influxdb
 | 
			
		||||
    - sensors
 | 
			
		||||
  block:
 | 
			
		||||
    - import_tasks: steps/create-service-directory.yml
 | 
			
		||||
    - import_tasks: steps/template-docker-compose.yml
 | 
			
		||||
 | 
			
		||||
    - name: Template config
 | 
			
		||||
      ansible.builtin.template:
 | 
			
		||||
        src: service.yml.j2
 | 
			
		||||
        dest: "{{ (service_path, 'influxdb.yml') | path_join }}"
 | 
			
		||||
        mode: "0600"
 | 
			
		||||
 | 
			
		||||
    - import_tasks: steps/template-site-config.yml
 | 
			
		||||
    - import_tasks: steps/start-service.yml
 | 
			
		||||
							
								
								
									
										72
									
								
								_ansible/roles/influxdb/vars/main.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								_ansible/roles/influxdb/vars/main.yml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,72 @@
 | 
			
		|||
svc:
 | 
			
		||||
  domain: "tick.serguzim.me"
 | 
			
		||||
  name: influxdb
 | 
			
		||||
  port: 8086
 | 
			
		||||
  data_dir: "/var/lib/influxdb2"
 | 
			
		||||
 | 
			
		||||
svc_yml:
 | 
			
		||||
  assets-path: ""
 | 
			
		||||
  bolt-path: "{{ (svc.data_dir, 'influxd.bolt') | path_join }}"
 | 
			
		||||
  e2e-testing: false
 | 
			
		||||
  engine-path: "{{ (svc.data_dir, 'engine') | path_join }}"
 | 
			
		||||
  feature-flags: {}
 | 
			
		||||
  http-bind-address: 0.0.0.0:{{ svc.port }}
 | 
			
		||||
  influxql-max-select-buckets: 0
 | 
			
		||||
  influxql-max-select-point: 0
 | 
			
		||||
  influxql-max-select-series: 0
 | 
			
		||||
  key-name: ""
 | 
			
		||||
  log-level: info
 | 
			
		||||
  nats-max-payload-bytes: 1048576
 | 
			
		||||
  nats-port: 4222
 | 
			
		||||
  no-tasks: false
 | 
			
		||||
  query-concurrency: 10
 | 
			
		||||
  query-initial-memory-bytes: 0
 | 
			
		||||
  query-max-memory-bytes: 0
 | 
			
		||||
  query-memory-bytes: 9223372036854775807
 | 
			
		||||
  query-queue-size: 10
 | 
			
		||||
  reporting-disabled: false
 | 
			
		||||
  secret-store: bolt
 | 
			
		||||
  session-length: 60
 | 
			
		||||
  session-renew-disabled: false
 | 
			
		||||
  storage-cache-max-memory-size: 1073741824
 | 
			
		||||
  storage-cache-snapshot-memory-size: 26214400
 | 
			
		||||
  storage-cache-snapshot-write-cold-duration: 10m0s
 | 
			
		||||
  storage-compact-full-write-cold-duration: 4h0m0s
 | 
			
		||||
  storage-compact-throughput-burst: 50331648
 | 
			
		||||
  storage-max-concurrent-compactions: 0
 | 
			
		||||
  storage-max-index-log-file-size: 1048576
 | 
			
		||||
  storage-retention-check-interval: 30m0s
 | 
			
		||||
  storage-series-file-max-concurrent-snapshot-compactions: 0
 | 
			
		||||
  storage-series-id-set-cache-size: 0
 | 
			
		||||
  storage-shard-precreator-advance-period: 30m0s
 | 
			
		||||
  storage-shard-precreator-check-interval: 10m0s
 | 
			
		||||
  storage-tsm-use-madv-willneed: false
 | 
			
		||||
  storage-validate-keys: false
 | 
			
		||||
  storage-wal-fsync-delay: 0s
 | 
			
		||||
  store: bolt
 | 
			
		||||
  testing-always-allow-setup: false
 | 
			
		||||
  tls-cert: ""
 | 
			
		||||
  tls-key: ""
 | 
			
		||||
  tls-min-version: "1.2"
 | 
			
		||||
  tls-strict-ciphers: false
 | 
			
		||||
  tracing-type: ""
 | 
			
		||||
  vault-addr: ""
 | 
			
		||||
  vault-cacert: ""
 | 
			
		||||
  vault-capath: ""
 | 
			
		||||
  vault-client-cert: ""
 | 
			
		||||
  vault-client-key: ""
 | 
			
		||||
  vault-client-timeout: 0s
 | 
			
		||||
  vault-max-retries: 0
 | 
			
		||||
  vault-skip-verify: false
 | 
			
		||||
  vault-tls-server-name: ""
 | 
			
		||||
  vault-token: ""
 | 
			
		||||
 | 
			
		||||
compose:
 | 
			
		||||
  watchtower: false
 | 
			
		||||
  image: influxdb
 | 
			
		||||
  volumes:
 | 
			
		||||
    - ./influxdb.yml:/etc/influxdb2/config.yml
 | 
			
		||||
    - data:{{ svc.data_dir }}
 | 
			
		||||
  file:
 | 
			
		||||
    volumes:
 | 
			
		||||
      data:
 | 
			
		||||
| 
						 | 
				
			
			@ -2,3 +2,6 @@
 | 
			
		|||
  ansible.builtin.command:
 | 
			
		||||
    cmd: docker compose up -d
 | 
			
		||||
    chdir: "{{ service_path }}"
 | 
			
		||||
  when: "'local-dev' != inventory_hostname"
 | 
			
		||||
  register: cmd_result
 | 
			
		||||
  changed_when: "cmd_result.stderr | regex_search('Started$')"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
{{ svc.domain }} {
 | 
			
		||||
	import default
 | 
			
		||||
	{{ svc.caddy_extra | default('') | indent(width='\t') }}
 | 
			
		||||
{{ svc.caddy_extra | default('') | indent(width='\t', first=True) }}
 | 
			
		||||
	reverse_proxy {{ svc.name }}:{{ svc.port }}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								_ansible/templates/service.yml.j2
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								_ansible/templates/service.yml.j2
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
{{ svc_yml | to_nice_yaml }}
 | 
			
		||||
		Reference in a new issue