![Bulat Gaifullin](/assets/img/avatar_default.png)
Avaliable commands: - create - Creates a new local mirrors. fuel-mirror create --input ubuntu.yaml - apply - Applies local mirrors for Fuel-environments. fuel-mirror apply --input centos.yaml -e "ENV1" Change-Id: I6cbf4e581a93b47cf75fb3c89aa1020a352784c8 Closes-Bug: #1487077 Implements: blueprint refactor-local-mirror-scripts
80 lines
2.0 KiB
Bash
Executable File
80 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "This script is DEPRECATED. Please use fuel-mirror utility!"
|
|
|
|
# This shell script was wraps the fuel-mirror utility to provide backward compatibility
|
|
# with previous version of tool.
|
|
|
|
usage() {
|
|
cat <<EOF
|
|
Usage: `basename $0` [options]
|
|
|
|
Create and update local mirrors of MOS and/or Ubuntu.
|
|
|
|
IMPORTANT!
|
|
If NO parameters specified, this script will:
|
|
- Create/Update both MOS and Ubuntu local mirrors
|
|
- Set them as repositories for existing NEW environments in Fuel UI
|
|
- Set them as DEFAULT repositories for new environments
|
|
|
|
Options:
|
|
|
|
-h| --help This help screen.
|
|
-d| --no-default Don't change default repositories for new environments
|
|
-a| --no-apply Don't apply changes to Fuel environments
|
|
-M| --mos Create/Update MOS local mirror only
|
|
-U| --ubuntu Create/Update Ubuntu local mirror only
|
|
-p| --password Fuel Master admin password (defaults to admin)
|
|
|
|
EOF
|
|
}
|
|
|
|
# Parse options
|
|
OPTS=`getopt -o hdaMUNp: -l help,no-default,no-apply,mos,ubuntu,password:,dry-run -- "$@"`
|
|
if [ $? != 0 ]; then
|
|
usage
|
|
exit 1
|
|
fi
|
|
|
|
eval set -- "$OPTS"
|
|
|
|
CMD_OPTS="--pattern=ubuntu"
|
|
|
|
while true ; do
|
|
case "$1" in
|
|
-h| --help ) usage ; exit 0;;
|
|
-d | --no-default ) OPT_NO_DEFAULT=1; shift;;
|
|
-a | --no-apply ) OPT_NO_APPLY=1; shift;;
|
|
-N | --dry-run ) EXEC_PREFIX="echo EXEC "; shift;;
|
|
-M | --mos ) GROUPS="$GROUPS mos"; shift;;
|
|
-U | --ubuntu ) GROUPS="$GROUPS ubuntu"; shift;;
|
|
-p | --password ) CMD_OPTS="$CMD_OPTS --fuel-password=$2"; shift; shift;;
|
|
-- ) shift; break;;
|
|
* ) break;;
|
|
esac
|
|
done
|
|
|
|
if [[ "$@" != "" ]]; then
|
|
echo "Invalid option -- $@"
|
|
usage
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "$GROUPS" == "" ]]; then
|
|
GROUPS="mos ubuntu"
|
|
fi
|
|
|
|
CMD_OPTS="CMD_OPTS --group $GROUPS"
|
|
|
|
$EXEC_PREFIX fuel-mirror create ${CMD_OPTS}
|
|
|
|
if [[ "$OPT_NO_DEFAULT" == "" ]]; then
|
|
CMD_OPTS="$CMD_OPTS --default"
|
|
fi
|
|
|
|
if [[ "OPT_NO_APPLY" == "" ]]; then
|
|
CMD_OPTS="$CMD_OPTS --apply"
|
|
fi
|
|
|
|
$EXEC_PREFIX fuel-mirror apply ${CMD_OPTS}
|