The purpose of this repository is to provide the necessary Infrastructure as Code (IaC) scripts to deploy the VRP_Solver project.
- A DigitalOcean Personal Access Token, which can be created via the DigitalOcean control panel.
- An SSH key named
vrp-env
added to DigitalOcean and GitHub accounts. Theinit.yml
Ansible Playbook will generate an SSH key pair inside the VRP_IaC directory. - A personal domain pointed to DigitalOcean’s nameservers.
The Control Node, the machine on which Ansible is installed, is responsible for executing Ansible Playbooks to configure the Ansible Hosts - the target servers that Ansible manages. Unlike other configuration management tools, Ansible is agentless, meaning that it does not require any specialized software to be installed on the Ansible Hosts being managed.
-
sudo apt update
-
sudo DEBIAN_FRONTEND=noninteractive apt install python3-pip -y
-
pip3 install ansible
-
git clone https://github.com/Papajohn77/VRP_IaC.git
-
cd ./VRP_IaC
-
ansible-playbook -e "email_address=<your_email_address>" init.yml
-
Add the contents of the SSH public key
tf-digitalocean.pub
to your GitHub account. Moreover, add the contents of the SSH public keytf-digitalocean.pub
to your DigitalOcean account and give it the name ofvrp-env
.cat tf-digitalocean.pub
-
export DIGITALOCEAN_TOKEN=<your_API_token>
-
cd ./vrp_env
-
terraform apply -var="domain_name=<your_domain_name>" --auto-approve
-
cat vrp-env-ipv4
-
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u root -i '<vrp-env-ipv4>,' -e 'domain_name=<your_domain_name>' -e 'email_address=<your_email_address>' -e 'pub_key=../tf-digitalocean.pub' --private-key ../tf-digitalocean setup.yml
- Ioannis Papadatos