Demo Repository for PoC (Proof-of-Concepts)
- Provisioning with Terraform & Ansible
- EC2 Docker Compose
- Python3 & Libraries
- Deploy with
- Own Services (Existing) with EC2 Instances
- Docker CLI
- Docker-Compose
- Ansible
- Managed Services with Amazon ECS
- AWS Copilot
- Own Services (Existing) with EC2 Instances
.
├── README.md
├── ansible.cfg
├── keys
│ ├── devopscorner-prod.pem
│ └── devopscorner-staging.pem
├── main.go
├── playbooks
│ ├── docker
│ └── java
├── requirements.txt
├── roles
│ ├── amazon-aws
│ ├── ansible-pretasks
│ ├── apt-clear-cache
│ ├── aws-cli
│ ├── certbot
│ ├── common
│ ├── docker
│ ├── java
│ ├── golang
│ └── requirements.yaml
└── services
├── demo
│ ├── ansible
│ │ └── inventory
│ │ ├── import_playbooks.yaml
│ │ ├── prod
│ │ │ ├── group_vars
│ │ │ │ ├── all.yaml
│ │ │ │ ├── inventory.ini
│ │ │ │ └── local.yaml
│ │ │ └── host_vars
│ │ └── staging
│ │ ├── group_vars
│ │ │ ├── all.yaml
│ │ │ ├── inventory.ini
│ │ │ ├── local.yaml
│ │ │ └── metadata_demo.yaml
│ │ └── host_vars
│ └── terraform
└── docker
├── ansible
│ └── inventory
│ ├── import_playbooks.yaml
│ ├── prod
│ │ ├── group_vars
│ │ │ ├── all.yaml
│ │ │ ├── inventory.ini
│ │ │ └── local.yaml
│ │ └── host_vars
│ └── staging
│ ├── group_vars
│ │ ├── all.yaml
│ │ ├── inventory.ini
│ │ ├── local.yaml
│ │ └── metadata_docker.yaml
│ └── host_vars
└── terraform
-
Install python-pip
sudo apt install python-pip
-
Suggested to using virtualenv, skip if you sure what you are doing,
sudo pip install virtualenv && virtualenv ~/venv && source ~/venv/bin/activate
-
Install
ansible-core
export ANSIBLE_VERSION=2.12.2 python3 -m pip install pip && \ pip3 install --upgrade pip==22.3.1 cffi &&\ # ================= # # Install Ansible # # ================= # pip3 install --no-cache-dir \ ansible-core==${ANSIBLE_VERSION} \ PyYaml \ Jinja2 \ httplib2 \ six \ requests \ boto3
-
In root of
ansible
directory.cd ansible && pip3 install -r requirements.txt
-
Install ansible galaxy roles
cd ansible && ansible-galaxy install -r roles/requirements.yml
ansible-playbook -i services/demo/ansible/inventory/staging/group_vars/inventory.ini playbooks/docker/service-docker.yaml \
-e "deploy_hosts=docker-golang-dev" \
-e "env=staging" \
-e "remote_user=ec2-user" \
-K -vv
-
Multi Tags Deployment (from ansible playbooks)
ansible-playbook -i services/demo/ansible/inventory/staging/group_vars/inventory.ini playbooks/golang/service-golang-demo.yaml \ -e "deploy_hosts=docker-golang-dev" \ -e "env=staging" \ -e "remote_user=ec2-user" \ --private-key=/opt/keyserver/devopscorner-staging.pem \ -K -vv -t=docker,golang
-
Ansible GOLANG-DEMO (Staging)
ansible-playbook -i services/demo/ansible/inventory/staging/group_vars/inventory.ini playbooks/golang/service-golang-demo.yaml \ -e "deploy_hosts=docker-golang-dev" \ -e "env=staging" \ -e "remote_user=ec2-user" \ --private-key=/opt/keyserver/devopscorner/devopscorner-staging.pem \ -K -vv
-
Ansible GOLANG-DEMO Container (Staging)
ansible-playbook -i services/demo/ansible/inventory/staging/group_vars/inventory.ini playbooks/docker/deploy-docker-compose.yaml \ -e "deploy_hosts=docker-golang-dev" \ -e "env=staging" \ -e "remote_user=ec2-user" \ --private-key=/opt/keyserver/devopscorner/devopscorner-staging.pem \ -K -vv
ansible-playbook -i services/demo/ansible/inventory/staging/group_vars/inventory.ini playbooks/docker/deploy-docker-compose.yaml \ -e "deploy_hosts=docker-golang-dev" \ -e "env=staging" \ -e "remote_user=ec2-user" \ -K -vv