-
Terraform Module that does the following:
- 1 VPC
- 4 Subnets
- 2 EC2 Instances - 1 Web and 1 DB
- 1 Elastic Load Balancer
-
Ansible Playbook that performs the following:
- Performs the Installation of the MySQL Database
- Creates the Database and Users and other Validations.
- Role that installs Apache HTTPD, PHP from third-party repositories.
- Configures the webserver
- Makes it ready for the Launch on the browser.
- Terraform is installed and the PATH is set.
Tip:
If not, download the setup using the instructions in the link below: https://www.terraform.io/intro/getting-started/install.html
- AWS Secret variables are set:
Tip:
export AWS_ACCESS_KEY_ID='****' export AWS_SECRET_ACCESS_KEY='***'
- Python 2.7+ and Ansible 2.x is installed
Tip: If you are on centos like platform, perform the below with sudo privs.
More info on: https://docs.ansible.com/ansible/devel/installation_guide/intro_installation.html
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -ivh epel-release-6-8.noarch.rpm yum install ansible -y
-
Clone and switch the directory to the Repository.
-
Navigate to the folder: mediawiki_infra:
cd mediawiki_infra
-
Initialize the working directory.:
terraform init
-
Create a plan and save it to the local file tfplan:
terraform plan -out=tfplan
-
Apply the plan stored in the file tfplan.
terraform apply -input=false tfplan -auto-approve
-
Run Ansible Playbook:
cd ..\ansible
ansible-playbook main.yml
- Open the Browser and complete the installation wizard.
NOTE: When i am executing the ansible task it is prompting for the mysql confirmation. this is the open point one should consider for executing the playbook