From: Oleg Broytman Date: Fri, 11 Mar 2022 21:53:46 +0000 (+0300) Subject: Feat(playbooks/debian): Pass the host to the scripts X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=2e50406aad442b9cb18ece40e9a8bf6cce227d4e;p=ansible.git Feat(playbooks/debian): Pass the host to the scripts --- 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"