Merge branch 'master' into modernize

modernize
Emilien Mantel 2025-06-02 12:24:37 +02:00
commit 1e4edc9ed4
8 changed files with 25 additions and 58 deletions

View File

@ -1 +0,0 @@
/home/triplestack/dev/PERSO/ansible-php

1
.gitignore vendored
View File

@ -6,3 +6,4 @@
/.idea
/.venv
/venv
/.ansible

View File

@ -1,55 +0,0 @@
---
env:
global:
- VAGRANT_VERSION='2.2.18'
jobs:
- PLATFORM='docker-debian-stretch-php70' ANSIBLE_VERSION='>=2.11,<2.12'
- PLATFORM='docker-debian-stretch-php74' ANSIBLE_VERSION='>=2.11,<2.12'
- PLATFORM='docker-debian-buster-php73' ANSIBLE_VERSION='>=2.11,<2.12'
- PLATFORM='docker-debian-bullseye-php74' ANSIBLE_VERSION='>=2.11,<2.12'
- PLATFORM='docker-debian-bullseye-php80' ANSIBLE_VERSION='>=2.11,<2.12'
- PLATFORM='docker-debian-buster-php74' ANSIBLE_VERSION='>=2.11,<2.12'
- PLATFORM='docker-ubuntu-bionic-php72' ANSIBLE_VERSION='>=2.11,<2.12'
os:
- linux
dist: focal
language: python
python:
- 3.8
services:
- docker
before_install:
- sudo apt-get -q update
- sudo apt-get install -y yamllint
- sudo wget -nv https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_x86_64.deb
- sudo dpkg -i vagrant_${VAGRANT_VERSION}_x86_64.deb
install:
- sudo pip install "ansible-core$ANSIBLE_VERSION"
- sudo pip install ansible-lint
- ansible-galaxy collection install community.general
script:
- VAGRANT_DEFAULT_PROVIDER=docker vagrant up $PLATFORM
- >
VAGRANT_DEFAULT_PROVIDER=docker vagrant provision $PLATFORM
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- VAGRANT_DEFAULT_PROVIDER=docker vagrant status
- >
yamllint .
&& (echo 'YAML lint test: pass' && exit 0)
|| (echo 'YAML lint test: fail' && exit 1)
- >
ansible-lint -v tests/test.yml
&& (echo 'Ansible lint test: pass' && exit 0)
|| (echo 'Ansible lint test: fail' && exit 1)
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View File

@ -1,7 +1,7 @@
Ansible PHP (+FPM) role for Debian / Ubuntu
===========================================
[![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-HanXHX.php-blue.svg)](https://galaxy.ansible.com/HanXHX/php) [![Build Status](https://app.travis-ci.com/HanXHX/ansible-php.svg?branch=master)](https://app.travis-ci.com/HanXHX/ansible-php)
[![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-hanxhx.php-blue.svg)](https://galaxy.ansible.com/hanxhx.php) ![GitHub Workflow Status (master)](https://img.shields.io/github/actions/workflow/status/hanxhx/ansible-php/molecule.yml?branch=master)
Install PHP on Debian / Ubuntu. Manage PHP-FPM, APCu, Opcache and Xdebug.

View File

@ -0,0 +1,6 @@
---
argument_specs:
main:
short_description: Main entry point
options: {}

4
requirements.yml 100644
View File

@ -0,0 +1,4 @@
---
collections:
- community.general

View File

@ -34,10 +34,11 @@
listen: "{{ p.listen | default(php_version | php_socket(p.name | default(p.pool_name))) }}",
user: "{{ p.user | default(php_default_user_group) }}",
group: "{% if p.user is defined %}{{ p.group | default(p.user) }}{% else %}{{ p.group | default(php_default_user_group) }}{% endif %}",
php_env: {% if p.php_env is defined %}{{ p.php_env | to_nice_json }}{% else %}{}{% endif %},
php_value: {% if p.php_value is defined %}{{ p.php_value | to_nice_json }}{% else %}{}{% endif %},
php_admin_value: {% if p.php_admin_value is defined %}{{ p.php_admin_value | to_nice_json }}{% else %}{}{% endif %},
{% for k, v in p.items() | list %}
{% if k not in ['name', 'pool_name', 'listen', 'user', 'group', 'php_value', 'php_admin_value'] %}
{% if k not in ['name', 'pool_name', 'listen', 'user', 'group', 'php_env', 'php_value', 'php_admin_value'] %}
{{ k }}: "{{ v }}"{% if not loop.last %},{% endif %}
{% endif %}
{% endfor %}
@ -65,6 +66,8 @@
group: root
mode: 0644
register: f
tags:
- skip_ansible_lint
- name: SETUP | Gathers new facts
ansible.builtin.setup:

View File

@ -421,10 +421,19 @@ catch_workers_output = {{ item.catch_workers_output | default('no') }}
;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M
{% if item.php_env is defined %}
{% for k, v in item.php_env.items() | list %}
env[{{ k }}] = {{ v }}
{% endfor %}
{% endif %}
{% if item.php_value is defined %}
{% for k, v in item.php_value.items() | list %}
php_value[{{ k }}] = {{ v }}
{% endfor %}
{% endif %}
{% if item.php_admin_value is defined %}
{% for k, v in item.php_admin_value.items() | list %}
php_admin_value[{{ k }}] = {{ v }}
{% endfor %}
{% endif %}
; vim:filetype=dosini