Giter Club home page Giter Club logo

ansible-to-migrate's Introduction

Building a simple LAMP stack and deploying Application using Ansible Playbooks.

These playbooks require Ansible 1.2.

These playbooks are meant to be a reference and starter's guide to building Ansible Playbooks. These playbooks were tested on CentOS 6.x but for this work we modified and tested in Ubuntu 16:04 ,so we recommend that you use Ubuntu to test these modules.

This LAMP stack can be on a single node or multiple nodes. The inventory file 'hosts' defines the nodes in which the stacks should be configured.

    [webservers]
    web_server

    [dbservers]
    mysql_server

Web_server

En el servidor web se realiza la instalación del servicio httpd y ntp, los cuales funcionan como servidor web y administrador de fechas . Para Cent os se usaron algunos modulos que son especificos :

yum: permite el uso del manejador de repositorios de Centos. El modulo equivalente en Ubuntu es 'apt'.

lineinfile: funciona como la funcion sed en bash, permite el reemplazo o adicion de contenido a archivos buscando este por una expresión regular, si la encuentra realiza lo que se colocó en el atributo line.En el atributo regexp se especifica la expresion regular a buscar

seboolean:permite la configuración de variables en el modulo seguro SELinux cambiando su estado a true o false dependiendo de su uso

mysql_server

Para la configuración del host con el motor de base de datos se instala con Ansible el motor MySQL y se realiza el uso de modulos ya explicados y aparecen 2 nuevos modulos.

mysql_db: este modulo permite gestionar las bases de datos en el motor MySQL

mysql_user: este modulo permite gestionar los usuarios de una base de datos MySQL

estos modulos interactuan directamente con el servicio MySQL no con el OS en el host, es decir que no necesitan una equivalencia en Ubuntu, por lo tanto su uso sera igual que si fuera Cent os .

Here the webserver would be configured on the local host and the dbserver on a server called "mysql_server". The stack can be deployed using the following command:

    ansible-playbook -i hosts site.yml

Once done, you can check the results by browsing to http://localhost/index.php. You should see a simple test page and a list of databases retrieved from the database server.

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.