mirror of
https://github.com/jcwimer/startup-infrastructure
synced 2026-03-24 22:34:42 +00:00
Test playbook run
This commit is contained in:
39
tests/files/group_vars_all
Normal file
39
tests/files/group_vars_all
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
# Variables listed here are applicable to all host groups
|
||||
|
||||
### Software versions
|
||||
docker_compose_version_to_install: 1.18.0
|
||||
docker_ce_version_to_install: 18.03.1
|
||||
|
||||
### User stuff
|
||||
standard_user: vagrant
|
||||
chosen_timezone: "America/New_York"
|
||||
# root domain for all services. You should have an A record for *.root_domain. For example, if your domain is test.com you should have an A record for *.test.com pointing to your node.
|
||||
# this will allow automatic dns for for things like dokuwiki.test.com and portainer.test.com
|
||||
root_domain: test.com
|
||||
|
||||
|
||||
|
||||
### Persistent storage if you are doing a single machine deploy, local is an option. If you are doing multi instance deploy, choose one of the following:
|
||||
# nfs
|
||||
# digitalocean
|
||||
# gcp
|
||||
# aws
|
||||
# openstack
|
||||
# ceph
|
||||
# then fill out the variables associated with your choice below
|
||||
storage_type: "local"
|
||||
|
||||
# nfs variables: these need defined if using nfs storage
|
||||
#nfs_address: 0.0.0.0
|
||||
#nfs_root_path: /some/filepath/on/nfs
|
||||
|
||||
# digitalocean variables: these need defined if using digitalocean storage
|
||||
|
||||
# gcp variables: these need defined if using gcp storage
|
||||
|
||||
# aws variables: these need defined if using aws storage
|
||||
|
||||
# openstack variables: these need defined if using openstack storage
|
||||
|
||||
# ceph variables: these need defined if using ceph storage
|
||||
@@ -1,6 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYa9zstumlg7XkKoNrJMlIN/zteqMA9J4GjuZA7r0xfMPrz4CglxzYKd/BhBpwp/HhU+vSR6vBa15kRODHdPZ+T1oXzMXAmMT3R2ZJRqF280Hsx9sK0X+FZWM84e4a1zQUrxuWyWJ4kKIiaX6DBAmhy8zHNvQ0c4Nk1exfwRicojaze71qrexSas4FHWaI4usC/g3mMKfiML/QX0UWW/G+D8qrg3cK3zClG916XlY/p1h9SWantqz75ea33TtmDNW6iCraKSjVeDGfzhshJsmQ7+/Rr/L4/s7hdpwTqdjSlJTIi61eBxcpDfMWBmsHOMZgnsTZ3wrdYXo70k44moA7 vagrant@test" >> /home/vagrant/.ssh/authorized_keys
|
||||
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYa9zstumlg7XkKoNrJMlIN/zteqMA9J4GjuZA7r0xfMPrz4CglxzYKd/BhBpwp/HhU+vSR6vBa15kRODHdPZ+T1oXzMXAmMT3R2ZJRqF280Hsx9sK0X+FZWM84e4a1zQUrxuWyWJ4kKIiaX6DBAmhy8zHNvQ0c4Nk1exfwRicojaze71qrexSas4FHWaI4usC/g3mMKfiML/QX0UWW/G+D8qrg3cK3zClG916XlY/p1h9SWantqz75ea33TtmDNW6iCraKSjVeDGfzhshJsmQ7+/Rr/L4/s7hdpwTqdjSlJTIi61eBxcpDfMWBmsHOMZgnsTZ3wrdYXo70k44moA7 vagrant@test" >> /root/.ssh/authorized_keys
|
||||
|
||||
cp /vagrant/tests/files/test_rsa /home/vagrant/test_rsa
|
||||
chmod 600 /home/vagrant/test_rsa
|
||||
chown vagrant:vagrant /home/vagrant/test_rsa
|
||||
6
tests/files/run-test-deploy.sh
Normal file
6
tests/files/run-test-deploy.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
project_dir="$(dirname $(dirname $( dirname $(readlink -f ${BASH_SOURCE[0]}))))"
|
||||
export PRIVATE_KEY=/home/vagrant/test_rsa;
|
||||
cp ${project_dir}/tests/files/hosts ${project_dir}/hosts
|
||||
cp ${project_dir}/tests/files/group_vars_all ${project_dir}/group_vars/all
|
||||
bash ${project_dir}/supporting-scripts/deploy.sh
|
||||
@@ -18,6 +18,9 @@ function run-tests {
|
||||
|
||||
test "Client vagrant machine can ssh into bootstrap." \
|
||||
"vagrant ssh client -c 'ssh -o StrictHostKeyChecking=no -i /home/vagrant/test_rsa vagrant@192.168.254.2 ls'"
|
||||
|
||||
test "Running deploy script should not fail." \
|
||||
"vagrant ssh client -c 'bash /vagrant/tests/files/run-test-deploy.sh'"
|
||||
}
|
||||
|
||||
function destroy-infrastructure {
|
||||
|
||||
Reference in New Issue
Block a user