aboutsummaryrefslogtreecommitdiff
path: root/tests/setup_deploy.sh
blob: 366bbf5a86e595525428ee2c658836ffe7134f94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/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