mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2024-11-22 15:32:18 +00:00
main: don't require directory input to be set
This commit is contained in:
parent
7294666400
commit
c94ab57c30
1 changed files with 3 additions and 6 deletions
9
main.sh
9
main.sh
|
@ -12,17 +12,14 @@ if test -z "$playbook"; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "$directory"; then
|
|
||||||
echo "You need to specify 'directory' input (root Ansible project directory)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -z "$key"; then
|
if test -z "$key"; then
|
||||||
echo "You need to specify 'key' input (SSH private key)"
|
echo "You need to specify 'key' input (SSH private key)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "$directory"
|
if test -n "$directory"; then
|
||||||
|
cd "$directory"
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "$HOME/.ssh"
|
mkdir -p "$HOME/.ssh"
|
||||||
echo "$key" > "$HOME/.ssh/id_rsa"
|
echo "$key" > "$HOME/.ssh/id_rsa"
|
||||||
|
|
Loading…
Reference in a new issue