Skip to content

matbrito/getty-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getty/IO challenge

Ansible playbook that provisions a simple HTTP server

Github

About the playbook

First PLAY (Create container)

This play is responsable for providing a container to setup http server. The container is built based on treasureboat/ssh and listens on port 22 for ssh connection. Last task ensure that the container is started

Second PLAY (Provision HTTP server)

Ensure that the system has all requirements for provisioning http server. First, a single pre task installs python using the raw module. After that apache is installed and started. Then index.html is copied to the remote machine and apache service is restarted to apply changes

Steps

Give your sudo/dzdo password

ansible-playbook provision.yml --ask-become-pass

Go to your browser and type:

http://172.17.0.2:80

Updating

Feel free to update index.html but don't forget to run the bellow command after changes:

ansible-playbook provision.yml --ask-pass --tags update

Obs

  • raw module is useful and should only be done in a few cases. A common case is installing python on a system without python installed by default. From ansible docs

  • In this case facts are not used, so gather_facts: no

  • Running with --tags docker executes only Create container play

  • Running with --tags provision executes only Provision HTTP server play

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages