From 34799f17ee6df9776de72813b4f98a348943be28 Mon Sep 17 00:00:00 2001 From: Nelson Wang Date: Fri, 13 Mar 2020 11:28:19 -0700 Subject: [PATCH] Limiting ansible-playbook to localhost only --- splunk/common-files/entrypoint.sh | 6 +++--- uf/common-files/entrypoint.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/splunk/common-files/entrypoint.sh b/splunk/common-files/entrypoint.sh index dca7aaef..9d390801 100755 --- a/splunk/common-files/entrypoint.sh +++ b/splunk/common-files/entrypoint.sh @@ -80,7 +80,7 @@ start_and_exit() { sh -c "echo 'starting' > ${CONTAINER_ARTIFACT_DIR}/splunk-container.state" setup prep_ansible - ansible-playbook $ANSIBLE_EXTRA_FLAGS -i inventory/environ.py site.yml + ansible-playbook $ANSIBLE_EXTRA_FLAGS -i inventory/environ.py -l localhost site.yml } start() { @@ -91,7 +91,7 @@ start() { configure_multisite() { prep_ansible - ansible-playbook $ANSIBLE_EXTRA_FLAGS -i inventory/environ.py multisite.yml + ansible-playbook $ANSIBLE_EXTRA_FLAGS -i inventory/environ.py -l localhost multisite.yml } restart(){ @@ -99,7 +99,7 @@ restart(){ sh -c "echo 'restarting' > ${CONTAINER_ARTIFACT_DIR}/splunk-container.state" prep_ansible ${SPLUNK_HOME}/bin/splunk stop 2>/dev/null || true - ansible-playbook -i inventory/environ.py start.yml + ansible-playbook -i inventory/environ.py -l localhost start.yml watch_for_failure } diff --git a/uf/common-files/entrypoint.sh b/uf/common-files/entrypoint.sh index 4bbf8ebb..c21c5de4 100755 --- a/uf/common-files/entrypoint.sh +++ b/uf/common-files/entrypoint.sh @@ -79,7 +79,7 @@ start_and_exit() { sh -c "echo 'starting' > ${CONTAINER_ARTIFACT_DIR}/splunk-container.state" setup prep_ansible - ansible-playbook $ANSIBLE_EXTRA_FLAGS -i inventory/environ.py site.yml + ansible-playbook $ANSIBLE_EXTRA_FLAGS -i inventory/environ.py -l localhost site.yml } start() { @@ -93,7 +93,7 @@ restart(){ sh -c "echo 'restarting' > ${CONTAINER_ARTIFACT_DIR}/splunk-container.state" prep_ansible ${SPLUNK_HOME}/bin/splunk stop 2>/dev/null || true - ansible-playbook -i inventory/environ.py start.yml + ansible-playbook -i inventory/environ.py -l localhost start.yml watch_for_failure }