3d7a0c6f55
So we can respect DRY and share as much code as possible I have broken out the common code between the aio and multinode gate scripts. Additionally, this lays the ground work for removing our policy on root-everywhere by using sudo. Once we get the non-root stuff worked out we can gate as non-root user. Change-Id: I781c597ab10f2296b95f51ae27e0fa617ffe0a66 Partially-Implements: blueprint multinode-gate
32 lines
655 B
Bash
Executable File
32 lines
655 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -o xtrace
|
|
set -o errexit
|
|
|
|
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
|
|
|
function create_keys {
|
|
# Setup ssh key as required
|
|
sudo -H ssh-keygen -f /root/.ssh/id_rsa -N ""
|
|
sudo -H cat /root/.ssh/id_rsa.pub | sudo -H tee /root/.ssh/authorized_keys
|
|
}
|
|
|
|
function install_deps {
|
|
# Install Ansible and docker-py
|
|
sudo -H pip install "ansible<2" docker-py
|
|
pip freeze | egrep "docker|ansible"
|
|
}
|
|
|
|
function copy_configs {
|
|
# Copy configs
|
|
sudo cp -a etc/kolla /etc/
|
|
}
|
|
|
|
create_keys
|
|
install_deps
|
|
copy_configs
|
|
|
|
# Link the logs directory into root
|
|
mkdir -p logs
|
|
sudo ln -s $(pwd)/logs /root/logs
|