Skip to content

FominSergiy/devops-for-programmers-project-lvl3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hexlet tests and linter status:

Actions Status

Requirements

I am using DigitalOcean to host my servers. For your vm make sure you use image with Docker installed, or install it yourself.

Repo Structure

--/
  |__terraform/   ---> dir contains IaC deployed for this app
  |__ansible/     ---> dir contains deployment configs for an app to VMs defined in **inventory.ini**
  |__Makefile     ---> file with commands to set up infra, deploy playbook, and work with vault

Prepare Your Project

Terraform

  • save secret.auto.tfvars in ./terraform/ folder, which will contain your
  • change name property in digitalocean_ssh_key terraform data block to the name of your ssh key in DO
  • to use remote backend
    • create free account with Terraform https://app.terraform.io/app
    • once account is created, follow the instructions on getting started page
    • create an organization and select the run terraform commands from local cli option
    • create a workspcae and follow instructions
    • change organization and workspaces inside the backend.tf file to what you have set them up in your account

Ansible

  • create vault_password file that you will be using to decrypt/encrypt your digital ocean token in Ansible.
$ make create-vault-pass
  • empty contents of /ansible/group_vars/webservers/datadog.yml file and replace it with your do_token.
vault_datadog_api_key : "your-do_token-here"

Once it's set, encrypt the file

$ make encrypt
  • run to install required roles/collections for ansible
$ make install

How to use

We need to bring up our infra before we can make any configs with ansible

  1. run terraform commands to bring up your infrastructure (please follow requirements first to set up your remote backend)
$ make init
$ make plan
$ make apply
  1. once infra is setup, take note of ip addresses in the terraform output block in the terminal. copy them over to inventory.ini
  2. run make deploy command to set-up your vms with react_tic_toe app.
$ make deploy

Deployed app

https://hexlet-sergiy.club

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published