This repository will install apache2 and add a custom page with simple text. Once the install is successful it will verify that the expected text is displayed in the web page.
- Install ansible
- Install python boto
- Download this repository and
cd ansible-apache
- Create an SSH key in AWS
- Downlod the private key to the ansible-apache directory make the file name match the AWS display name
- If it was named "ansible" in AWS, name the ssh key file "ansible.pem"
- Create an AWS Security Group
- Make sure the Security Group allows connections from your computers IP
- A simple Security Group is to allow all traffic from 0.0.0.0 (not recommended for production servers)
- If it isn't already make wrapper.py executable
chmod +x wrapper.py
- Run the command:
./wrapper.py -n <server-name> -g <group-name> -k <ssh-key-name>
- Replace the arguments above with the appropriate values
- -g specifies the security group name as it appears in AWS
- -k specifies the name of the ssh key as it appears in AWS
- Example:
./wrapper.py -n ansible_apache_testing -g ansible_testing -k ansible
- Other options are available for wrapper.py, run the command
wrapper.py -h
for more information
At the end of the deployment of apache2 and replacing the default web page a test is run to verify the expected text is displayed. This can be verified by going to the IP address of the new machine in a browser.