Setup infrastructure with Terraform
For control your servers infrastructure use following steps:
- Check
./iac/terraform/*.tffiles, update your provider and infrastructure settings - Add provider credentials. For example for AWS use
~/.aws/credentialsfile. Addaws_access_key_idandaws_secret_access_key. Configuration and credential file settings - Add your deployment public key
id_rsa.pubto./iac/terraform/public_keys/folder - Run terraform commands:
make terraform [command]
Examples:
make terraform init
make terraform plan
make terraform apply
Automate server apps with Ansible
For running server setup automations use this steps:
- Add public key to
~/authorized_keysfile on servers (usemake terraform applycommand if you haven’t already done so) - Check your credentials in
./.sshfolder. Use ssh config file to simplify connections. - Check
./iac/ansible/inventory.ymlservers and credentials, host names should be the same as on ssh config file. - Check
./iac/ansible/playbook.ymlfile hosts and tasks. Hosts must correspond to inventory hosts. - Run ansible command:
make ansible
This will run main playbook ansible-playbook -i iac/ansible/inventory.yml iac/ansible/playbook.yml for all hosts.
To run playbook for specific host use command:
make ansible -- --limit [host]
After that you will be able to run CI/CD deployment pipelines automations.