Skip to content

Commit 3064fbe

Browse files
committed
Improved AIO deployment script
The automated AIO deployment script has been improved in several ways: The password check is now the first command to run Adds advice about running with non-lvm images The python3-venv package is installed on Ubuntu hosts The purge-command-not-found playbook is automatically run before host configuration
1 parent 11d036c commit 3064fbe

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

etc/kayobe/environments/ci-aio/automated-setup.sh

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,35 @@
22

33
set -eux
44

5-
cat << EOF | sudo tee -a /etc/hosts
6-
10.205.3.187 pulp-server pulp-server.internal.sms-cloud
7-
EOF
8-
9-
if sudo vgdisplay | grep -q lvm2; then
10-
sudo pvresize $(sudo pvs --noheadings | head -n 1 | awk '{print $1}')
11-
sudo lvextend -L 4G /dev/rootvg/lv_home -r || true
12-
sudo lvextend -L 4G /dev/rootvg/lv_tmp -r || true
13-
fi
14-
155
BASE_PATH=~
166
KAYOBE_BRANCH=stackhpc/yoga
177
KAYOBE_CONFIG_BRANCH=stackhpc/yoga
8+
KAYOBE_AIO_LVM=true
189

1910
if [[ ! -f $BASE_PATH/vault-pw ]]; then
2011
echo "Vault password file not found at $BASE_PATH/vault-pw"
2112
exit 1
2213
fi
2314

15+
if sudo vgdisplay | grep -q lvm2; then
16+
sudo pvresize $(sudo pvs --noheadings | head -n 1 | awk '{print $1}')
17+
sudo lvextend -L 4G /dev/rootvg/lv_home -r || true
18+
sudo lvextend -L 4G /dev/rootvg/lv_tmp -r || true
19+
elif $KAYOBE_AIO_LVM; then
20+
echo "This environment is only designed for LVM images. If possible, switch to an LVM image.
21+
To ignore this warning, set KAYOBE_AIO_LVM to false in this script."
22+
exit 1
23+
fi
24+
25+
cat << EOF | sudo tee -a /etc/hosts
26+
10.205.3.187 pulp-server pulp-server.internal.sms-cloud
27+
EOF
28+
2429
if type dnf; then
2530
sudo dnf -y install git
2631
else
2732
sudo apt update
28-
sudo apt -y install gcc git libffi-dev python3-dev python-is-python3
33+
sudo apt -y install gcc git libffi-dev python3-dev python-is-python3 python3-venv
2934
fi
3035

3136
cd $BASE_PATH
@@ -35,6 +40,11 @@ pushd src
3540
[[ -d kayobe-config ]] || git clone https://github.com/stackhpc/stackhpc-kayobe-config kayobe-config -b $KAYOBE_CONFIG_BRANCH
3641
popd
3742

43+
if ! sudo vgdisplay | grep -q lvm2; then
44+
rm $BASE_PATH/src/kayobe-config/etc/kayobe/environments/ci-aio/inventory/group_vars/controllers/lvm.yml
45+
sed -i -e '/controller_lvm_groups/,+2d' $BASE_PATH/src/kayobe-config/etc/kayobe/environments/ci-aio/controllers.yml
46+
fi
47+
3848
mkdir -p venvs
3949
pushd venvs
4050
if [[ ! -d kayobe ]]; then
@@ -68,7 +78,7 @@ source kayobe-env --environment ci-aio
6878

6979
kayobe control host bootstrap
7080

71-
kayobe playbook run etc/kayobe/ansible/growroot.yml
81+
kayobe playbook run etc/kayobe/ansible/growroot.yml etc/kayobe/ansible/purge-command-not-found.yml
7282

7383
kayobe overcloud host configure
7484

0 commit comments

Comments
 (0)