Add option to spit out facts.
This commit is contained in:
13
setup.sh
13
setup.sh
@@ -20,7 +20,7 @@ server_config="$config_dir/server.ini"
|
|||||||
function usage {
|
function usage {
|
||||||
cat <<- EOF
|
cat <<- EOF
|
||||||
|
|
||||||
$PROG [-l] [-b branch_name] [-g] [-w] [-s] [-h]
|
$PROG [-l] [-b branch_name] [-g] [-w] [-s] [-f] [-h]
|
||||||
Program to initialize synchronization with Hyperling's Ansible configuration.
|
Program to initialize synchronization with Hyperling's Ansible configuration.
|
||||||
$URL
|
$URL
|
||||||
|
|
||||||
@@ -32,7 +32,8 @@ function usage {
|
|||||||
-g : Enable the General config with test contents.
|
-g : Enable the General config with test contents.
|
||||||
-w : Enable the Workstation config with test contents.
|
-w : Enable the Workstation config with test contents.
|
||||||
-s : Enable the Server config with test contents.
|
-s : Enable the Server config with test contents.
|
||||||
-h : Display this help text
|
-f : Display this system's facts.
|
||||||
|
-h : Display this help text.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
exit $1
|
exit $1
|
||||||
@@ -40,13 +41,14 @@ function usage {
|
|||||||
|
|
||||||
## Parameter Parsing ##
|
## Parameter Parsing ##
|
||||||
|
|
||||||
while getopts ":lb:gwsh" arg; do
|
while getopts ":lb:gwsfh" arg; do
|
||||||
case $arg in
|
case $arg in
|
||||||
l) local="Y" && echo "Running $LOCAL as the playbook." ;;
|
l) local="Y" && echo "Running $LOCAL as the playbook." ;;
|
||||||
b) branch="$OPTARG" && echo "Using branch $branch instead of $BRANCH." ;;
|
b) branch="$OPTARG" && echo "Using branch $branch instead of $BRANCH." ;;
|
||||||
g) create_general="Y" && echo "Requested '$general_config'." ;;
|
g) create_general="Y" && echo "Requested '$general_config'." ;;
|
||||||
w) create_workstation="Y" && echo "Requested '$workstation_config'." ;;
|
w) create_workstation="Y" && echo "Requested '$workstation_config'." ;;
|
||||||
s) create_server="Y" && echo "Requested '$server_config'." ;;
|
s) create_server="Y" && echo "Requested '$server_config'." ;;
|
||||||
|
f) show_facts="Y" ;;
|
||||||
h) usage ;;
|
h) usage ;;
|
||||||
*) echo "ERROR: Parameter $OPTARG was not recognized." && usage 1 ;;
|
*) echo "ERROR: Parameter $OPTARG was not recognized." && usage 1 ;;
|
||||||
esac
|
esac
|
||||||
@@ -125,6 +127,11 @@ if [[ `which ansible > /dev/null; echo $?` != 0 ]]; then
|
|||||||
fi
|
fi
|
||||||
echo "Installed!"
|
echo "Installed!"
|
||||||
|
|
||||||
|
if [[ "$show_facts" == "Y" ]]; then
|
||||||
|
echo "Showing Ansible Facts"
|
||||||
|
ansible localhost -m setup --connection=local
|
||||||
|
fi
|
||||||
|
|
||||||
#echo "Adding Ansible Collections..."
|
#echo "Adding Ansible Collections..."
|
||||||
#ansible-galaxy collection install community.general
|
#ansible-galaxy collection install community.general
|
||||||
#echo "Added!"
|
#echo "Added!"
|
||||||
|
|||||||
Reference in New Issue
Block a user