diff --git a/defaults/main.yml b/defaults/main.yml index 992e3ea..149bc15 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -50,7 +50,7 @@ influxdb_container_standalone_setup_details: 'INFLUXDB_HTTP_HTTPS_PRIVATE_KEY': "/etc/ssl/user/privkey-influxdb.pem", 'INFLUXDB_HTTP_LOG_ENABLED': "false", 'INFLUXDB_DATA_INDEX_VERSION': "tsi1", - 'INFLUXDB_DATA_CACHE_MAX_MEMORY_SYZE': '1048576000', + 'INFLUXDB_DATA_CACHE_MAX_MEMORY_SIZE': '1048576000', 'INFLUXDB_DATA_CACHE_SNAPSHOT_WRITE_COLD_DURATION': "10s", 'INFLUXDB_DATA_MAX_VALUES_PER_TAG': '3000000', 'INFLUXDB_LOGGING_LEVEL': "error" diff --git a/tasks/configure.yml b/tasks/configure.yml index c3f3db2..c01034c 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -12,7 +12,7 @@ community.docker.docker_container_exec: container: "{{ influxdb_container.name }}" command: | - influx -execute "CREATE USER "{{ item.username }}" WITH PASSWORD '"{{ item.password }}"' WITH ALL PRIVILEGES" + influx -execute "CREATE USER \"{{ item.username }}\" WITH PASSWORD '{{ item.password }}' WITH ALL PRIVILEGES" loop: "{{ influxdb_users.admin }}" when: 'not ansible_check_mode and "unable to parse authentication credentials" not in should_create_admin.stdout' @@ -21,7 +21,7 @@ container: "{{ influxdb_container.name }}" command: | influx -username "{{ influxdb_users.admin[0].username }}" -password "{{ influxdb_users.admin[0].password }}" - -execute "CREATE USER "{{ item.username }}" WITH PASSWORD '"{{ item.password }}"' " + -execute "CREATE USER \"{{ item.username }}\" WITH PASSWORD '{{ item.password }}'" loop: "{{ influxdb_users.regular }}" when: not ansible_check_mode @@ -30,7 +30,7 @@ container: "{{ influxdb_container.name }}" command: | influx -username "{{ influxdb_users.admin[0].username }}" -password "{{ influxdb_users.admin[0].password }}" - -execute "CREATE DATABASE "{{ item }}"" + -execute "CREATE DATABASE \"{{ item }}\"" loop: "{{ influxdb_databases }}" when: not ansible_check_mode @@ -39,7 +39,7 @@ container: "{{ influxdb_container.name }}" command: | influx -username "{{ influxdb_users.admin[0].username }}" -password "{{ influxdb_users.admin[0].password }}" - -execute "CREATE RETENTION POLICY oneweek ON {{ item }} DURATION {{ influxdb_retention_policy.duration }} REPLICATION {{ influxdb_retention_policy.replication }} {{ influxdb_retention_policy.default }}" + -execute "CREATE RETENTION POLICY {{ influxdb_retention_policy.policy_name }} ON {{ item }} DURATION {{ influxdb_retention_policy.duration }} REPLICATION {{ influxdb_retention_policy.replication }} {{ influxdb_retention_policy.default }}" loop: "{{ influxdb_retention_policy.databases }}" when: not ansible_check_mode diff --git a/tasks/configure_ssl.yml b/tasks/configure_ssl.yml index 626ff3e..7d58a27 100644 --- a/tasks/configure_ssl.yml +++ b/tasks/configure_ssl.yml @@ -12,7 +12,7 @@ community.docker.docker_container_exec: container: "{{ influxdb_container.name }}" command: | - influx -ssl -host "{{ hostname }}" -execute "CREATE USER "{{ item.username }}" WITH PASSWORD '"{{ item.password }}"' WITH ALL PRIVILEGES" + influx -ssl -host "{{ hostname }}" -execute "CREATE USER \"{{ item.username }}\" WITH PASSWORD '{{ item.password }}' WITH ALL PRIVILEGES" loop: "{{ influxdb_users.admin }}" when: 'not ansible_check_mode and "unable to parse authentication credentials" not in should_create_admin.stdout' @@ -21,7 +21,7 @@ container: "{{ influxdb_container.name }}" command: | influx -ssl -host "{{ hostname }}" -username "{{ influxdb_users.admin[0].username }}" -password "{{ influxdb_users.admin[0].password }}" - -execute "CREATE USER "{{ item.username }}" WITH PASSWORD '"{{ item.password }}"' " + -execute "CREATE USER \"{{ item.username }}\" WITH PASSWORD '{{ item.password }}'" loop: "{{ influxdb_users.regular }}" when: not ansible_check_mode @@ -30,7 +30,7 @@ container: "{{ influxdb_container.name }}" command: | influx -ssl -host "{{ hostname }}" -username "{{ influxdb_users.admin[0].username }}" -password "{{ influxdb_users.admin[0].password }}" - -execute "CREATE DATABASE "{{ item }}"" + -execute "CREATE DATABASE \"{{ item }}\"" loop: "{{ influxdb_databases }}" when: not ansible_check_mode @@ -39,7 +39,7 @@ container: "{{ influxdb_container.name }}" command: | influx -ssl -host "{{ hostname }}" -username "{{ influxdb_users.admin[0].username }}" -password "{{ influxdb_users.admin[0].password }}" - -execute "CREATE RETENTION POLICY oneweek ON {{ item }} DURATION {{ influxdb_retention_policy.duration }} REPLICATION {{ influxdb_retention_policy.replication }} {{ influxdb_retention_policy.default }}" + -execute "CREATE RETENTION POLICY {{ influxdb_retention_policy.policy_name }} ON {{ item }} DURATION {{ influxdb_retention_policy.duration }} REPLICATION {{ influxdb_retention_policy.replication }} {{ influxdb_retention_policy.default }}" loop: "{{ influxdb_retention_policy.databases }}" when: not ansible_check_mode