deep_scrub_choked
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
# Generate a custom ssh config from Vagrant so that it can then be used by
|
||||
# ansible.cfg
|
||||
|
||||
path=$1
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
echo "A path to the scenario is required as an argument and it wasn't provided"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$path"
|
||||
|
||||
# Let's print vagrant status for debug purposes and to give the VMs a second to
|
||||
# settle before asking vagrant for SSH config.
|
||||
vagrant status || true
|
||||
|
||||
n=0
|
||||
until [ "$n" -ge 5 ]
|
||||
do
|
||||
vagrant ssh-config > vagrant_ssh_config && break
|
||||
n=$((n+1))
|
||||
echo "\`vagrant ssh-config\` failed. Retrying."
|
||||
sleep 3
|
||||
done
|
||||
|
||||
if [ "$n" -eq 5 ]; then
|
||||
echo "\`vagrant ssh-config\` failed 5 times. This is a fatal error."
|
||||
cat vagrant_ssh_config
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
if [[ -n $1 ]]; then
|
||||
DIRECTORY=$1
|
||||
shift
|
||||
else
|
||||
DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
fi
|
||||
pushd "${DIRECTORY}"
|
||||
|
||||
if [[ "${CEPH_ANSIBLE_VAGRANT_BOX}" =~ "centos/stream" ]]; then
|
||||
EL_VERSION="${CEPH_ANSIBLE_VAGRANT_BOX: -1}"
|
||||
LATEST_IMAGE="$(curl -s https://cloud.centos.org/centos/${EL_VERSION}-stream/x86_64/images/CHECKSUM | sed -nE 's/^SHA256.*\((.*-([0-9]+).*vagrant-libvirt.box)\).*$/\1/p' | sort -u | tail -n1)"
|
||||
vagrant box remove "${CEPH_ANSIBLE_VAGRANT_BOX}" --all --force || true
|
||||
vagrant box add --force --provider libvirt --name "${CEPH_ANSIBLE_VAGRANT_BOX}" "https://cloud.centos.org/centos/${EL_VERSION}-stream/x86_64/images/${LATEST_IMAGE}" --force
|
||||
fi
|
||||
|
||||
retries=0
|
||||
until [ $retries -ge 5 ]
|
||||
do
|
||||
echo "Attempting to start VMs. Attempts: $retries"
|
||||
timeout 10m time vagrant up "$@" && break
|
||||
retries=$((retries+1))
|
||||
sleep 5
|
||||
done
|
||||
|
||||
sleep 10
|
||||
popd
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
function git_diff_to_head {
|
||||
git diff --diff-filter=MT --no-color origin/"${GITHUB_BASE_REF}"..HEAD
|
||||
}
|
||||
|
||||
function match_file {
|
||||
git_diff_to_head | sed -n "s|^+++.*\\($1.*\\)|\\1|p"
|
||||
}
|
||||
|
||||
# group_vars / defaults
|
||||
match_file "/defaults/main.yml"
|
||||
nb=$(match_file "/defaults/main.yml" | wc -l)
|
||||
if [[ "$nb" -eq 0 ]]; then
|
||||
echo "group_vars has not been touched."
|
||||
else
|
||||
match_file "group_vars/"
|
||||
nb_group_vars=$(match_file "group_vars/" | wc -l)
|
||||
if [[ "$nb" -gt "$nb_group_vars" ]]; then
|
||||
echo "One or more files containing default variables has/have been modified."
|
||||
echo "You must run 'generate_group_vars_sample.sh' to generate the group_vars template files."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# ceph_release_num[ceph_release] statements check
|
||||
if match_file "roles/ceph-defaults/" | grep -E '^[<>+].*- ceph_release_num\[ceph_release\]'; then
|
||||
echo "Do not use statements like '- ceph_release_num[ceph_release]' in ceph-defaults role!"
|
||||
echo "'ceph_release' is only populated **after** the play of ceph-defaults, typically in ceph-common or ceph-docker-common."
|
||||
exit 1
|
||||
fi
|
||||
echo "No '- ceph_release_num[ceph_release]' statements found in ceph-defaults role!"
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
if [[ "$(git log --oneline --no-merges origin/"${GITHUB_BASE_REF}"..HEAD | wc -l)" -ne "$(git log --no-merges origin/"${GITHUB_BASE_REF}"..HEAD | grep -c Signed-off-by)" ]]; then
|
||||
echo "One or more commits is/are missing a Signed-off-by. Add it with 'git commit -s'."
|
||||
exit 1
|
||||
else
|
||||
echo "Sign-off ok!"
|
||||
fi
|
||||
Reference in New Issue
Block a user