@@ -15,6 +15,7 @@ IPVAR=""
1515DEBUG_MODE=" false"
1616OFFLINE_MODE=" false"
1717SKIP_PACKAGES=" false"
18+ GRAPH_ROOT=" /var/lib/containers/storage"
1819
1920# Environment variables for non-interactive mode
2021NON_INTERACTIVE=${NON_INTERACTIVE:- false}
@@ -31,6 +32,7 @@ usage() {
3132 echo " -o, --offline Enable offline mode (skip internet-dependent tasks)"
3233 echo " --skip-packages Skip package installation (for development)"
3334 echo " -p, --playbook PLAYBOOK_PATH Specify path to playbook (default: ./ansible/site.yml)"
35+ echo " -g, --graph-root GRAPH_ROOT Change the graphroot directory (where volumes are stored)"
3436 echo " -h, --help Show this help message"
3537 echo
3638 echo " Environment Variables:"
@@ -66,6 +68,10 @@ while [[ $# -gt 0 ]]; do
6668 PLAYBOOK_PATH=" $2 "
6769 shift 2
6870 ;;
71+ -g|--graph-root)
72+ GRAPH_ROOT=" $2 "
73+ shift 2
74+ ;;
6975 -h|--help)
7076 usage
7177 ;;
@@ -494,9 +500,9 @@ run_playbook() {
494500 sudo chown $( whoami) :$( whoami) /opt/ansible-tmp
495501
496502 if [ -f " $SCRIPT_DIR /inventory" ]; then
497- ansible-playbook -i " $SCRIPT_DIR /inventory" " $PLAYBOOK_PATH " --extra-vars ' {"has_sudo_access":"' " ${HAS_SUDO_ACCESS} " ' ","clone_dir":"' " ${SCRIPT_DIR} " ' ","offline_mode":' " ${OFFLINE_MODE} " ' }' $ANSIBLE_OPTS
503+ ansible-playbook -i " $SCRIPT_DIR /inventory" " $PLAYBOOK_PATH " --extra-vars ' {"has_sudo_access":"' " ${HAS_SUDO_ACCESS} " ' ","clone_dir":"' " ${SCRIPT_DIR} " ' ","offline_mode":' " ${OFFLINE_MODE} " ' , "storage_graphroot": ' " ${GRAPH_ROOT} " ' }' $ANSIBLE_OPTS
498504 else
499- ansible-playbook " $PLAYBOOK_PATH " --extra-vars ' {"has_sudo_access":"' " ${HAS_SUDO_ACCESS} " ' ","clone_dir":"' " ${SCRIPT_DIR} " ' ","offline_mode":' " ${OFFLINE_MODE} " ' }' $ANSIBLE_OPTS
505+ ansible-playbook " $PLAYBOOK_PATH " --extra-vars ' {"has_sudo_access":"' " ${HAS_SUDO_ACCESS} " ' ","clone_dir":"' " ${SCRIPT_DIR} " ' ","offline_mode":' " ${OFFLINE_MODE} " ' , "storage_graphroot": ' " ${GRAPH_ROOT} " ' }' $ANSIBLE_OPTS
500506 fi
501507
502508 if [ $? -eq 0 ]; then
@@ -1079,4 +1085,4 @@ if [ "$OFFLINE_MODE" = "true" ]; then
10791085fi
10801086
10811087echo -e " ${GREEN} All operations completed successfully!${NC} "
1082- exit 0
1088+ exit 0
0 commit comments