<commit_before>#!/usr/bin/env bash

############### Setup tools
msg() {
    d="\e[33m"  # opening ansi color code for yellow text
    e="\e[0m"   # ending ansi code
    printf '%b%b%b\n' "$d" "$1" "$e" >&2
}

############### Basic deployment

msg "[!!!] This script will change the 'toad' user password. Ctrl-C now to quit."
sleep 6

current_user=$(whoami)

if [ "$current_user" != "toad" ]; then
    msg "Please run this as the 'toad' user after bootstrapping."
    exit -1
fi

msg "Setup the 'toad' user password for all-in-one."
sudo su -
echo "toad" | passwd toad --stdin
logout

pushd $HOME/toad

msg "Configuring ~/.ansible/vars/toad_vars.yml."
mkdir ~/.ansible/vars/
cat > ~/.ansible/vars/toad_vars.yml <<EOF
elk_deployed: false
filebeat_deployed: false
EOF

msg "Setting up our slave configuration."
cat > hosts/minions <<EOF
[jenkins_slave]
slave01 ansible_connection=ssh ansible_host=172.18.0.1 ansible_user=toad ansible_ssh_pass=<PASSWORD>

[jenkins_slave:vars]
slave_description=TOAD Testing Node
slave_remoteFS=/home/stack
slave_port=22
slave_credentialsId=stack-credential
slave_label=toad
EOF

msg "Spinning up a Jenkins Master."
docker-compose up -d jenkins_master

msg "Deploying a Jenkins Master and Slave."
ansible-playbook site.yml --limit jenkins_master,jenkins_slave -e use_openstack_deploy=false -e deploy_type='docker' -c docker
<commit_msg>[bugfix] replaced sudo su - with a sudo /bin/bash -c<commit_after>#!/usr/bin/env bash

############### Setup tools
msg() {
    d="\e[33m"  # opening ansi color code for yellow text
    e="\e[0m"   # ending ansi code
    printf '%b%b%b\n' "$d" "$1" "$e" >&2
}

############### Basic deployment

msg "[!!!] This script will change the 'toad' user password. Ctrl-C now to quit."
sleep 6

current_user=$(whoami)

if [ "$current_user" != "toad" ]; then
    msg "Please run this as the 'toad' user after bootstrapping."
    exit -1
fi

msg "Setup the 'toad' user password for all-in-one."
sudo /bin/bash -c 'echo "toad" | passwd toad --stdin'

pushd $HOME/toad

msg "Configuring ~/.ansible/vars/toad_vars.yml."
mkdir ~/.ansible/vars/
cat > ~/.ansible/vars/toad_vars.yml <<EOF
elk_deployed: false
filebeat_deployed: false
EOF

msg "Setting up our slave configuration."
cat > hosts/minions <<EOF
[jenkins_slave]
slave01 ansible_connection=ssh ansible_host=172.18.0.1 ansible_user=toad ansible_ssh_pass=<PASSWORD>

[jenkins_slave:vars]
slave_description=TOAD Testing Node
slave_remoteFS=/home/stack
slave_port=22
slave_credentialsId=stack-credential
slave_label=toad
EOF

msg "Spinning up a Jenkins Master."
docker-compose up -d jenkins_master

msg "Deploying a Jenkins Master and Slave."
ansible-playbook site.yml --limit jenkins_master,jenkins_slave -e use_openstack_deploy=false -e deploy_type='docker' -c docker

{'fraction_non_alphanumeric': 0.14213564213564214, 'fraction_numerical': 0.012987012987012988, 'mean_word_length': 4.579476861167002, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5065733', 'n_tokens_mistral': 1053, 'n_tokens_neox': 991, 'n_words': 288}