X-Git-Url: https://gerrit.mcp.mirantis.com/gitweb?p=salt-formulas%2Finfluxdb.git;a=blobdiff_plain;f=influxdb%2Fserver.sls;h=4276a8e86de5d663ba455e497c8a37854e110751;hp=c77ec826dee18ddd632da25de59c022801488306;hb=2ebe40eaedfa9985ff19acc7f7b914d813f8f904;hpb=014e68d949c660835f911bc3c4552cb7add24f6e diff --git a/influxdb/server.sls b/influxdb/server.sls index c77ec82..4276a8e 100644 --- a/influxdb/server.sls +++ b/influxdb/server.sls @@ -1,6 +1,15 @@ {%- from "influxdb/map.jinja" import server with context %} +{% from "linux/map.jinja" import system with context %} + {%- if server.enabled %} +linux_packages: + pkg.installed: + - pkgs: {{ system.pkgs }} + +include: + - linux.system.repo + influxdb_packages: pkg.installed: - names: {{ server.pkgs }} @@ -21,6 +30,8 @@ influxdb_default: - require: - pkg: influxdb_packages +{%- if not grains.get('noservices', False) %} + influxdb_service: service.running: - enable: true @@ -32,6 +43,8 @@ influxdb_service: - file: influxdb_config - file: influxdb_default +{%- endif %} + {% set url_for_query = "http://{}:{}/query".format(server.http.bind.address, server.http.bind.port) %} {% set admin_created = false %} @@ -41,8 +54,10 @@ influxdb_service: influxdb_create_admin: cmd.run: - name: curl -f -S -POST "{{ url_for_query }}" {{ query_create_admin }} || curl -f -S -POST "{{ admin_url }}" {{ query_create_admin }} + {%- if not grains.get('noservices', False) %} - require: - service: influxdb_service + {%- endif %} {% set url_for_query = admin_url %} {% set admin_created = true %} {%- endif %}