Skip to content

Commit

Permalink
Merge pull request #15 from clouddrove/CD-305
Browse files Browse the repository at this point in the history
Cd 305
  • Loading branch information
Sohan Yadav authored Dec 2, 2021
2 parents 98916c2 + 276fa05 commit 710f3f9
Show file tree
Hide file tree
Showing 14 changed files with 124 additions and 33 deletions.
1 change: 1 addition & 0 deletions .cache/roles/ansible_role_php
1 change: 1 addition & 0 deletions .cache/roles/role-php
16 changes: 16 additions & 0 deletions .github/workflows/galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Release to Ansible Galaxy

'on':
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-18.04
steps:
- name: galaxy
uses: robertdebock/[email protected]
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
46 changes: 39 additions & 7 deletions .github/workflows/lint.yml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ name: Lint

jobs:

test:
name: Lint
yamllint:
name: yamllint
runs-on: ubuntu-latest

steps:
- name: Check out the codebase.
uses: actions/checkout@v2
Expand All @@ -21,21 +20,54 @@ jobs:
with:
python-version: '3.x'

- name: Install test dependencies.
run: pip3 install yamllint ansible-lint
- name: Install yamllist
run: pip3 install yamllint

- name: Run yamllint.
run: yamllint .

ansible-lint:
name: ansible-lint
runs-on: ubuntu-latest
steps:
- name: Checkout the codebase.
uses: actions/checkout@v2

- name: Set up Python 3.7.
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install ansible and other packages
run: pip3 install ansible ansible-lint

- name: Run ansible-lint.
run: ansible-lint

pre-commit:
name: 'Pre-Commit'
needs:
- yamllint
- ansible-lint
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/[email protected]

- name: Install ansible-lint
run: pip3 install ansible-lint

- name: 'Pre-Commit 🔎'
uses: pre-commit/[email protected]
continue-on-error: true

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
with:
status: ${{ job.status }}
fields: repo,author
author_name: 'Clouddrove'
author_name: 'CloudDrove Inc.'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_ANSIBLE }}
if: always()
57 changes: 57 additions & 0 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: 'Create README.md file'
'on':
push:
branches:
- master

jobs:
readme-create:
name: 'Autogenerate Readme file'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@master

- name: Set up Python 3.7.
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: 'Generate readme.md from readme.yaml'
uses: 'clouddrove/[email protected]'
with:
actions_subcommand: 'readme'
github_token: '${{ secrets.GITHUB }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install ansible-lint
run: pip3 install ansible-lint

- name: pre-commit check errors
uses: pre-commit/[email protected]
continue-on-error: true

- name: pre-commit fix errors
uses: pre-commit/[email protected]
continue-on-error: true

- name: 'push readme'
uses: 'clouddrove/[email protected]'
continue-on-error: true
with:
actions_subcommand: 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
with:
status: ${{ job.status }}
fields: repo,author
author_name: 'CloudDrove Inc.'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_ANSIBLE }}
if: always()
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v2.2.3
rev: v3.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand All @@ -15,7 +15,7 @@ repos:
- id: check-added-large-files

- repo: https://github.com/ansible/ansible-lint.git
rev: v4.1.0
rev: v5.0.8
hooks:
- id: ansible-lint
files: \.(yaml|yml)$
2 changes: 1 addition & 1 deletion .yamllint
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ extends: default

rules:
line-length:
max: 120
max: 153
level: warning
truthy:
allowed-values: ['true', 'false', 'yes', 'no']
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ Followiing things includes in this role:
$ 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]).

Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# php versions supported versions 7.0>
php_version: 7.3
php_version: 7.4

# configurations
php_dir: "/etc/php/{{ php_version }}"
Expand Down
1 change: 0 additions & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
state: reloaded
when: state == "present"


- name: restart php-fpm
service:
name: "php{{ php_version }}-fpm"
Expand Down
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ galaxy_info:
author: Anmol Nagpal
description: This ansible role for install php.
company: "CloudDrove Inc."
role_name: ansible_role_php
license: "license (BSD, MIT)"
min_ansible_version: 2.4
platforms:
Expand Down
5 changes: 5 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
src: "{{ item }}"
dest: "{{ php_fpm_dir }}/pool.d/{{ item | basename }}"
force: true
mode: 0644
with_fileglob:
- ../templates/config/pool.d/*.conf

Expand All @@ -30,6 +31,7 @@
src: "{{ item }}"
dest: "{{ php_dir }}/mods-available/{{ item | basename }}"
force: true
mode: 0644
with_fileglob:
- ../templates/config/mods-available/*.ini

Expand All @@ -38,12 +40,14 @@
src: config/php.ini
dest: "{{ php_fpm_dir }}/php.ini"
force: true
mode: 0644

- name: copy pecl extensions .ini files
template:
src: "{{ item }}"
dest: "{{ php_dir }}/mods-available/{{ item | basename }}"
force: true
mode: 0644
with_fileglob:
- ../templates/config/mods-available/*.ini

Expand All @@ -52,6 +56,7 @@
src: config/php.ini
dest: "{{ php_dir }}/apache2/php.ini"
force: true
mode: 0644
when: is_web_server_is_apache
notify:
- restart apache2
Expand Down
12 changes: 0 additions & 12 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
'php{{ php_version }}-xml',
'php{{ php_version }}-zip',
'php{{ php_version }}-dev',
'php{{ php_version }}-mongodb',
'php{{ php_version }}-sqlite3',
'pkg-config',
'libssl-dev',
Expand Down Expand Up @@ -61,14 +60,3 @@
command: pecl update-channels
become: true
when: state == "present"

- name: enable pecl extensions
pear:
name: "pecl/{{ item }}"
state: "{{ state }}"
ignore_errors: true
with_items:
- mongodb
- apcu
- mcrypt-1.0.2
- redis
4 changes: 0 additions & 4 deletions templates/config/mods-available/mongodb.ini

This file was deleted.

0 comments on commit 710f3f9

Please sign in to comment.