Skip to content
This repository has been archived by the owner on Jul 13, 2018. It is now read-only.

Deploying system services and docker containers using Ansible

License

Notifications You must be signed in to change notification settings

cimermanGregor/3fs_deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

3fs_deployment

Deploying system services and docker containers using Ansible on Ubuntu 16.04

List of actions

Deployment procedure consists of following procedures:

  • Update Ubuntu server
  • Install and configure firewall on server
  • Install and configure DNS with specific zone
  • Install Docker and deploy simple PHP application

Prerequisites

Ubuntu server 16.04 for running services, Python2.7, PIP and git installed. The rest is installed by Ansible.

Configuring parameters

Configuring services to fit in your environment you have to configure following variables

  • iptables_ssh_networks: networks from which you allow SSH access to hosts
  • iptables_trusted_networks: networks from which you allow any traffic
  • iptables_public_ports: publicly available ports
  • bind_zone: zone for DNS
  • bind_records: DNS records in the zone file of format {name: x, type: [CNAME, A, AAAA,...] record: y}

Deployment procedure

Make sure the repository is located on host and change directory to it. Next step is to use ansible playbooks to do all the heavy lifting. We have to setup the environment.

cd ansible
virtualenv .venv
source .venv/bin/activate
pip install -r requirements.txt

Run the Ansible playbook to configure our host

ansible-playbook -i production site.yaml

For running playbook on the local host use localhost inventory

ansible-playbook -i localhost site.yaml

End result

To deploy simple PHP application use project Simple PHP Application using docker-compose command

git clone https://github.com/cimermanGregor/simple_php_application.git
cd simple_php_application
mv docker-compose-dockerhub.yaml docker-compose.yaml
docker-compose up -d

Screenshot of Simple PHP Application

About

Deploying system services and docker containers using Ansible

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published