Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sohan Yadav committed Aug 24, 2019
0 parents commit cdca48e
Show file tree
Hide file tree
Showing 20 changed files with 1,069 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ignored files
.idea
*.iml
*.zip
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v2.2.3
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/ansible/ansible-lint.git
rev: v4.1.0
hooks:
- id: ansible-lint
files: \.(yaml|yml)$
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Cloud Drove

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export GENIE_PATH ?= $(shell 'pwd')/../../../genie

include $(GENIE_PATH)/Makefile
133 changes: 133 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<!-- This file was automatically generated by the `geine`. Make all changes to `README.yaml` and run `make readme` to rebuild this file. -->


<p align="center"> <img src="https://user-images.githubusercontent.com/50652676/62451340-ba925480-b78b-11e9-99f0-13a8a9cc0afa.png" width="100" height="100"></p>

<h1 align="center">
Ansible Role PHP
</h1>

<p align="center" style="font-size: 1.2rem;">
This ansible role is used to install PHP server on Debian.
</p>

<p align="center">

<a href="https://www.ansible.com">
<img src="https://img.shields.io/badge/Ansible-2.8-green?style=flat&logo=ansible" alt="Ansible">
</a>
<a href="LICENSE.md">
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="Licence">
</a>
<a href="https://ubuntu.com/">
<img src="https://img.shields.io/badge/ubuntu-16.x-orange?style=flat&logo=ubuntu" alt="Distribution">
</a>
<a href="https://ubuntu.com/">
<img src="https://img.shields.io/badge/ubuntu-18.x-orange?style=flat&logo=ubuntu" alt="Distribution">
</a>


</p>
<p align="center">

<a href='https://facebook.com/sharer/sharer.php?u=https://github.com/clouddrove/ansible-role-php'>
<img title="Share on Facebook" src="https://user-images.githubusercontent.com/50652676/62817743-4f64cb80-bb59-11e9-90c7-b057252ded50.png" />
</a>
<a href='https://www.linkedin.com/shareArticle?mini=true&title=Ansible+Role+PHP&url=https://github.com/clouddrove/ansible-role-php'>
<img title="Share on LinkedIn" src="https://user-images.githubusercontent.com/50652676/62817742-4e339e80-bb59-11e9-87b9-a1f68cae1049.png" />
</a>
<a href='https://twitter.com/intent/tweet/?text=Ansible+Role+PHP&url=https://github.com/clouddrove/ansible-role-php'>
<img title="Share on Twitter" src="https://user-images.githubusercontent.com/50652676/62817740-4c69db00-bb59-11e9-8a79-3580fbbf6d5c.png" />
</a>

</p>
<hr>



We eat, drink, sleep and most importantly love **DevOps**. DevOps always promotes automation and standardisation. While setting up various environments like local, dev, testing, production, etc. it is critical to maintain the same environment across. This can easily be achieved using automating the environment setup & installation with the help of ansible-playbooks.

Smaller roles are created for each environment elements; which also include tasks & tests. These roles can then be grouped together in [ansible-playbook](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html) to achieve the desired yet consistent results.



## Prerequisites

This module has a few dependencies:

- [Ansible2.8](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
- [Python](https://www.python.org/downloads)




## What Includes

Followiing things includes in this role:
- Php-7.3
- Php-fpm
- Pecl
- Composer







## Example Playbook

**IMPORTANT:** Since the `master` branch used in `source` varies based on new modifications, we suggest that you use the release versions [here](https://github.com/clouddrove/ansible-role-php/releases).


```yaml
- hosts: localhost
remote_user: ubuntu
become: true
roles:
- clouddrove.ansible_role_php
```


## Variables

```yaml
php_version: 7.3
php_dir: "/etc/php/{{ php_version }}"
php_fpm_dir: "/etc/php/{{ php_version }}/fpm"
log_path: /var/log/php
state: present
is_web_server_is_apache: true
```


## Installation

```console
$ ansible-galaxy install clouddrove.ansible_role_php
```






## Feedback
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/ansible-role-php/issues), or feel free to drop us an email at [[email protected]](mailto:[email protected]).

If you have found it worth your time, go ahead and give us a ★ on [our GitHub](https://github.com/clouddrove/ansible-role-php)!

## About us

At [CloudDrove][website], we offer expert guidance, implementation support and services to help organisations accelerate their journey to the cloud. Our services include docker and container orchestration, cloud migration and adoption, infrastructure automation, application modernisation and remediation, and performance engineering.

<p align="center">We are <b> The Cloud Experts!</b></p>
<hr />
<p align="center">We ❤️ <a href="https://github.com/clouddrove">Open Source</a> and you can check out <a href="https://github.com/clouddrove">our other modules</a> to get help with your new Cloud ideas.</p>

[website]: https://clouddrove.com
[github]: https://github.com/clouddrove
[linkedin]: https://cpco.io/linkedin
[twitter]: https://twitter.com/clouddrove/
[email]: https://clouddrove.com/contact-us.html
[terraform_modules]: https://github.com/clouddrove?utf8=%E2%9C%93&q=terraform-&type=&language=
74 changes: 74 additions & 0 deletions README.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#

# Name of this project
name: Ansible Role PHP

# License of this project
license: "MIT"

# Canonical GitHub repo
github_repo: clouddrove/ansible-role-php

# Badges to display
badges:
- name: "Ansible"
image: "https://img.shields.io/badge/Ansible-2.8-green?style=flat&logo=ansible"
url: "https://www.ansible.com"
- name: "Licence"
image: "https://img.shields.io/badge/License-MIT-blue.svg"
url: "LICENSE.md"
- name: "Distribution"
image: "https://img.shields.io/badge/ubuntu-16.x-orange?style=flat&logo=ubuntu"
url: "https://ubuntu.com/"
- name: "Distribution"
image: "https://img.shields.io/badge/ubuntu-18.x-orange?style=flat&logo=ubuntu"
url: "https://ubuntu.com/"

# Prerequesties to display
# yamllint disable
prerequesties:
- name: "Ansible2.8"
url: "https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html"
- name: "Python"
url: "https://www.python.org/downloads"
# yamllint enable
# What Includes to display
what_includes:
- name: "Php-7.3"
- name: "Php-fpm"
- name: "Pecl"
- name: "Composer"

# description of this project
description: |-
This ansible role is used to install PHP server on Debian.
# How to use this project
usage: |-
```yaml
- hosts: localhost
remote_user: ubuntu
become: true
roles:
- clouddrove.ansible_role_php
```
# Variables use in the project
variables: |-
```yaml
php_version: 7.3
php_dir: "/etc/php/{{ php_version }}"
php_fpm_dir: "/etc/php/{{ php_version }}/fpm"
log_path: /var/log/php
state: present
is_web_server_is_apache: true
```
# How to install project
installation: |-
```console
$ ansible-galaxy install clouddrove.ansible_role_php
```
14 changes: 14 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
# php versions supported versions 7.0>
php_version: 7.3

# configurations
php_dir: "/etc/php/{{ php_version }}"
php_fpm_dir: "/etc/php/{{ php_version }}/fpm"
log_path: /var/log/php

# state
state: present

# install php for apache web server
is_web_server_is_apache: true
23 changes: 23 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---

- name: start php-fpm
service:
name: "php{{ php_version }}-fpm"
state: started

- name: reload php-fpm
service:
name: "php{{ php_version }}-fpm"
state: reloaded
when: state == "present"


- name: restart php-fpm
service:
name: "php{{ php_version }}-fpm"
state: restarted

- name: restart apache2
service:
name: apache2
state: restarted
29 changes: 29 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---

dependencies: []

galaxy_info:
author: clouddrove
description: This ansible role for install php.
company: "CloudDrove, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 2.4
platforms:
- name: Debian
versions:
- jessie
- stretch
- name: Ubuntu
versions:
- trusty
- xenial
- bionic
galaxy_tags:
- server
- php
- composer
- apache
- linux
- ubuntu
- debian
- fpm
22 changes: 22 additions & 0 deletions tasks/composer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---

- name: download composer
get_url:
url: http://getcomposer.org/installer
force: true
dest: /tmp/composer
mode: 0755

# yamllint disable
- name: install composer
command: php /tmp/composer --install-dir=/usr/local/bin creates=/usr/local/bin/composer

- name: rename composer.phar to composer
command: mv /usr/local/bin/composer.phar /usr/local/bin/composer creates=/usr/local/bin/composer
# yamllint enable

- name: make composer executable
file:
path: /usr/local/bin/composer
mode: a+x
state: file
Loading

0 comments on commit cdca48e

Please sign in to comment.