Razique Mahroua
2020-03-18 b85c91a8192593f6b62f93e11c971868964343a9
commit | author | age
b7573b 1 # Simple example
MK 2
3 A simple deplyoment creating a bastion host and two worker nodes. It can't get simpler ...
4
5 ### Environment variables
6
7 Deployment is controlled by two configuration files: 
8
9 * env_vars.yml
10 * sample_vars.yml
11
12 `env_vars.yml` defines all configuration parameters that COULD be modified, whereas `sample_vars.yml` is a *template* for all environment specific values that HAVE to be changed.
13
14 Start by creating a copy of `sample_vars.yml` and rename it (e.g. `my_sample_vars.yml`). Then modifiy all parameters to match your environment.
15
16 #### Secrets
17
18 Some deployments need **secrets** e.g. your AWS credentials or API tokens. 
19
20 DO NOT add these to git !
21
22 Instead create a file called e.g. `./ansible/my_secret_vars.yml` and store all secrets etc. there. This file can also be reused for other deplyoments.
23
24 NOTE:  
25
26 Both `my_sample_vars.yml` `my_secret.vars.yml` are in the `.gitignore` configuration which SHOULD protect you from adding them to git!
27
28 ### Run the Ansible playbooks
29
30 Run follwoing commands from the `./ansible` folder:
31
32 #### Install
33
34 ```shell
35 ansible-playbook main.yml -e @configs/simple-example/my_sample_vars.yml -e @my_secret_vars.yml
36 ```
37
38 #### Uninstall
39
40 ```shell
41 ansible-playbook destroy.yml -e @configs/simple-example/my_sample_vars.yml -e @my_secret_vars.yml
42 ```