Skip to content

Ansible role to deploy a LAMP Stack on centos7/amazon-linux2 hosts.

Notifications You must be signed in to change notification settings

anandg1/ansible-role-lamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible role for building a LAMP stack in Amazon Linux2 and CentOS 7

This is a Ansible role to deploy a LAMP Stack on centos7/amazon-linux2 hosts.

  • Roles let you automatically load related vars, files, tasks, handlers, and other Ansible artifacts based on a known file structure. After you group your content in roles, you can easily reuse them and share them with other users.Each directory contains a main.yml file which contains relevant content.

This is the structure of role I have created for this project,

├── defaults
│   └── main.yml
├── files
├── handlers
│   └── main.yml
├── meta
│   └── main.yml
├── README.md
├── tasks
│   ├── amazon.yml
│   ├── centos.yml
│   └── main.yml
├── templates
│   ├── httpd.conf.temp
│   └── virtualhost.conf.temp
├── tests
│   ├── inventory
│   └── test.yml
└── vars
    └── main.yml

STACK

  • Apache Webserver
  • php7.4
  • Mariadb-database-server

Prerequisites

Latest ansible version installed.

Hosts

  • Add hosts in an inventory file(say inventory.txt) under your working directory.

Configuration

  • Configuration of variables for both apache (port number,httpd_user,httpd_group) and mariadb (domain_name,mariadb_root_password,mariadb_database_name,mariadb_database_user_name,mariadb_database_user_password) are included in main.yml file the vars section, which can be modified as per the requirement.

Setup

To check if the playbook have any syntax error, run:

ansible-playbook -i inventory_file your_custom.yml --syntax-check

Inroder to execute, run

ansible-playbook -i inventory_file your_custom.yml

'your_custom.yml' can be any playbook with the role included in it.

About

Ansible role to deploy a LAMP Stack on centos7/amazon-linux2 hosts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages