infra base quick start

Local configuration

Requirements

Docker environment

You can create a container to ensure you have all the correct softwares and dependencies to work with the project, just by typing :

./workstation/launch.sh

And congratulations ! you have your workstation ready for work.

Project setup

Set your naming conventions

To set the configuration for your account,

There is an example of configuration here :

configs
└── mygroup
    └── myenv
        ├── ssh
        │   └── README.md
        ├── ansible
        └── terraform
            ├── commons.tfvars
            ├── layer-01-networking.tfvars
            └── layer-02-nginx.tfvars

To adapt to your own account and set your own values,

just copy paste the folder “mygroup”, and change the names of the folders :

Ansible configuration

ansible-galaxy install wescale.nginx -p ./ansible/roles/external/
export ANSIBLE_CONFIG="$PWD/<mygroup>-<myenv>-ansible.cfg"

Build Infrastructure

Run bootstrap script:

python -m iac_bootstrap.infra_bootstrap --provider aws --account < mygroup >-< myenv >

Run Build-infra script:

python -m iac_bootstrap.infra_builder_terraform --account < mygroup >-< myenv >

And Voilà, you have created an infrastructure in your aws account !

Ansible Nginx deployment

Now the final step is to install nginx:

python -m iac_bootstrap.install_nginx --group < mygroup > --env < myenv >

At this point, you can access to your public instance with http and you will view Nginx server page.

image