From 2e50406aad442b9cb18ece40e9a8bf6cce227d4e Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 12 Mar 2022 00:53:46 +0300 Subject: [PATCH] Feat(playbooks/debian): Pass the host to the scripts --- playbooks/debian/add-apache-vhost | 8 +++++--- playbooks/debian/add-dns-domain | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/playbooks/debian/add-apache-vhost b/playbooks/debian/add-apache-vhost index 5acb1e2..4139eb4 100755 --- a/playbooks/debian/add-apache-vhost +++ b/playbooks/debian/add-apache-vhost @@ -1,13 +1,15 @@ #! /bin/sh -if [ -z "$1" ]; then - echo "Usage: $0 vhost [...params...]" >&2 +if [ -z "$2" ]; then + echo "Usage: $0 host vhost [...params...]" >&2 exit 1 fi +host="$1" +shift vhost="$1" shift cd "`dirname \"$0\"`" && exec ../run-roles debian/add-apache-vhost "$@" \ - -e virtual_host="$vhost" -e gather_facts=true + -e virtual_host="$vhost" -e gather_facts=true -e hosts="$host" diff --git a/playbooks/debian/add-dns-domain b/playbooks/debian/add-dns-domain index 8e81790..68bd6de 100755 --- a/playbooks/debian/add-dns-domain +++ b/playbooks/debian/add-dns-domain @@ -1,13 +1,15 @@ #! /bin/sh -if [ -z "$1" ]; then - echo "Usage: $0 domain [...params...]" >&2 +if [ -z "$2" ]; then + echo "Usage: $0 host domain [...params...]" >&2 exit 1 fi +host="$1" +shift domain="$1" shift cd "`dirname \"$0\"`" && exec ../run-roles debian/add-dns-domain "$@" \ - -e domain="$domain" -e gather_facts=true + -e domain="$domain" -e gather_facts=true -e hosts="$host" -- 2.39.5