state_top:
base:
"*":
+ - linux
- influxdb
pillars:
top.sls:
base:
"*":
+ - linux_repo_influxdata
- influxdb
+ pillars-from-files:
+ linux_repo_influxdata.sls: tests/pillar/repo_influxdata.sls
dependencies:
- name: linux
repo: git
{%- 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 }}
- require:
- pkg: influxdb_packages
-{%- if not grains.get('noservices', False) %}
-
influxdb_service:
service.running:
- enable: true
# This delay is needed before being able to send data to server to create
# users and databases.
- init_delay: 5
+ {%- if grains.get('noservices') %}
+ - onlyif: /bin/false
+ {%- endif %}
- watch:
- 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 %}
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 %}
port: 8091
- host: idb03.local
port: 8091
-linux:
- system:
- enabled: true
- repo:
- docker:
- source: 'deb https://repos.influxdata.com/ubuntu {{ grains.get('oscodename') }} stable'
- key_url: https://repos.influxdata.com/influxdb.key
- file: /etc/apt/sources.list
--- /dev/null
+linux:
+ system:
+ enabled: true
+ repo:
+ linux_influxdata:
+ source: "deb https://repos.influxdata.com/ubuntu {{ grains.get('oscodename') }} stable"
+ architectures: amd64
+ key_url: "https://repos.influxdata.com/influxdb.key"
influxdb:
server:
enabled: true
-linux:
- system:
- enabled: true
- repo:
- docker:
- source: 'deb https://repos.influxdata.com/ubuntu {{ grains.get('oscodename') }} stable'
- key_url: https://repos.influxdata.com/influxdb.key
- file: /etc/apt/sources.list
SALT_CONFIG_DIR=${SALT_CONFIG_DIR:-${BUILDDIR}/salt}
SALT_CACHE_DIR=${SALT_CACHE_DIR:-${SALT_CONFIG_DIR}/cache}
-SALT_OPTS="${SALT_OPTS} --retcode-passthrough --local -c ${SALT_CONFIG_DIR}"
+SALT_OPTS="${SALT_OPTS} --retcode-passthrough --local -c ${SALT_CONFIG_DIR} --log-file=/dev/null"
if [ "x${SALT_VERSION}" != "x" ]; then
PIP_SALT_VERSION="==${SALT_VERSION}"
[ ! -d ${SALT_PILLAR_DIR} ] && mkdir -p ${SALT_PILLAR_DIR}
echo "base:" > ${SALT_PILLAR_DIR}/top.sls
for pillar in ${PILLARDIR}/*; do
+ grep ${FORMULA_NAME}: ${pillar} &>/dev/null || continue
state_name=$(basename ${pillar%.sls})
echo -e " ${state_name}:\n - ${state_name}" >> ${SALT_PILLAR_DIR}/top.sls
done
echo "base:" > ${SALT_FILE_DIR}/top.sls
for pillar in ${PILLARDIR}/*.sls; do
+ grep ${FORMULA_NAME}: ${pillar} &>/dev/null || continue
state_name=$(basename ${pillar%.sls})
echo -e " ${state_name}:\n - ${FORMULA_NAME}" >> ${SALT_FILE_DIR}/top.sls
done
file_client: local
cachedir: ${SALT_CACHE_DIR}
verify_env: False
+minion_id_caching: False
file_roots:
base:
run() {
for pillar in ${PILLARDIR}/*.sls; do
+ grep ${FORMULA_NAME}: ${pillar} &>/dev/null || continue
state_name=$(basename ${pillar%.sls})
salt_run --id=${state_name} state.show_sls ${FORMULA_NAME} || (log_err "Execution of ${FORMULA_NAME}.${state_name} failed"; exit 1)
done