From dd092102fbcc837a550438488b8db8b86b9fd1fc Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Wed, 6 Apr 2022 11:58:35 +0200 Subject: [PATCH] added ansible configuration and deployment script --- .gitignore | 1 + ansible.cfg | 5 +++++ deploy.sh | 14 ++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 .gitignore create mode 100644 ansible.cfg create mode 100755 deploy.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..10da9c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +inventory.ini diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..8376ef3 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,5 @@ +[defaults] +interpreter_python = auto_silent +inventory = inventory.ini +remote_user = root +nocows = True diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..641b99a --- /dev/null +++ b/deploy.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -e + +PLAYBOOK=$1 +LIMIT="" +shift + +for SERVICE in $@; do + LIMIT="${LIMIT} --limit $1" + shift +done +LIMIT=$(echo "${LIMIT}" | sed 's/^ //') + +ansible-playbook "${LIMIT}" "${PLAYBOOK}"