Giter VIP home page Giter VIP logo

vagrant_ansible's Introduction

Starter project on Vagrant & Ansible

About project

This is demo/test project based on Vagrant and Ansible tools. You will be able to setup:

Loadbalancer and two web servers are using SSL Certs (all included in project)

1 x LoadBalancer HAProxy

2 x Nginx + Tomcat + demo tomcat app (with reverse proxy)

(TODO) 2 x PostgresSQL server master and slave with async database

!!! Do NOT use this example project in Production ENV. as it has not been tested properly and has no firewall setting, except SELinux enalbled !!!

All above mentioned will use Centos 7 minimal "centos/7 CentOS Linux 7 x86_64 Vagrant Box" from [ Vagrant boxes Atlas ] (https://atlas.hashicorp.com/boxes/search)

Before :

PC or Laptop with virtualization

Hardware Requirement:

PC or Laptop with virtualization

OS Requirement:

[ Centos 7 minimal ] (https://www.centos.org/)

Software Requirement:

[ VirtualBox by Oracle ] (https://www.virtualbox.org/)
  • I assume you have already installed Required OS and Software then skip to step 2. if not then install Cenots 7 minimal and start with step 1.

1. Project setup process:
1.1. When installing centos 7 create user vagrant with administrator privileges.
1.2. After copy GitHub project to your server and put it in your working directory, for exmaple "myproject"
1.3. Then set chmod to bash script "server_setup.sh" and run the script:

chmod 0700 server_setup.sh
./server_setup.sh
  • This script will install all nessasary software to run the Vagrant & Ansible project

2. Running the project:
2.1. Before you start project please edit:
2.1.1. IP used in this project:
Loadbalancer server Public network IP`s: 10.10.20.111
Loadbalancer server Private network IP`s: 192.168.56.11

WEB servers Public network IP`s: 10.10.20.121 - 122
WEB servers Private network IP`s: 192.168.56.21 - 22

Database servers Public network IP`s: 10.10.20.131 - 122
Database servers Private network IP`s: 192.168.56.31 - 32

2.1.2. hosts file in direcotry "provisioning/src/hosts" and edit IP`s you will use in you project. Edit only first part of IP, example "10.10.20.111" -> "10.20.30.111"
2.1.3. Copy edited content to you local hosts file /etc/hosts
2.2. Vagrantfile file in main project direcotry change IP`s according to hosts file.
2.3. Run command:

vagrant up

and you will setup all server automaticly.
2.5. Access machines by domain name:
HAProxy: node.bz/stats
Web page: node.bz | This domain will be redirected to secure SSL connection -> https://node.bz

2.6. Access machines using via SSH:
If you are not in your project working directory, please, go to it, and see first machines you have setup and make shure they are running before try to acccess them:

vagrant status

To access any of VM machines, type following command, for example machine "loadbalancer":

vagrant ssh loadbalancer

Default username for all VM machines is vagrant and password also is vagrant

2.7. Stop all VM machines:

vagrant halt

2.8. Stop one or several VM machines:

vagrant halt web1

2.8. Destory one or several VM machines:

vagrant destroy web1
vagrant destroy web1 web2 db1 db2

vagrant_ansible's People

Contributors

indexslv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.