Compare commits

...

29 Commits

Author SHA1 Message Date
Jeff Geerling 51684c4c27 Make local dev with molecule a little easier. 2024-01-24 21:59:52 -06:00
Jeff Geerling c95df25578 Stale bot is now Stale GitHub Action. 2023-07-10 17:48:39 -05:00
Jeff Geerling 8b216f5586
Merge pull request #395 from blizzz/support_status_path
add option to set pm.status_path
2023-07-07 18:10:31 -05:00
Arthur Schiwon ec5109a0e2
add option to set pm.status_path
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-07-06 13:48:51 +02:00
Jeff Geerling 79c917470c Don't commit code past midnight. 2023-06-30 01:24:51 -05:00
Jeff Geerling 94cab5d78a Make sure dirmngr is present on Ubuntu. 2023-06-30 01:20:46 -05:00
Jeff Geerling d39a057c03 Remove official support for RHEL. Rocky/Alma/Stream support is best-effort. 2023-06-23 10:57:21 -05:00
Jeff Geerling 968636be8b
Merge pull request #397 from BartOpitz/bugfix/with_flattened
fix with_flattened
2023-06-21 22:30:13 -05:00
Jeff Geerling 19956ca910 Issue #408: Tweak spacing. 2023-06-21 22:28:38 -05:00
Jeff Geerling 2d4501688a
Merge pull request #408 from KiweeEu/feature/do-not-run-php-fpm-in-check-mode
Do not run php-fpm service when ansible is in check mode
2023-06-21 22:27:57 -05:00
Jeff Geerling 3a6b924388
Merge pull request #394 from blizzz/fix-max_requests
Fix variable name for pm.max_requests.
2023-06-21 22:27:23 -05:00
Jeff Geerling 2ceda25029 Remove unnecessary dependency. Maybe. 2023-06-12 23:28:53 -05:00
Jeff Geerling bd001863bc
Merge pull request #402 from pfrenssen/json-extension-included-php80
Only install the JSON extension on Debian for PHP 7.4 and below
2023-06-12 23:26:36 -05:00
Jeff Geerling f4b9f3c20d Bump Debian support matrix up one, drop Ubuntu 16.04. 2023-06-12 23:23:28 -05:00
Jeff Geerling b5e137eba0
Merge pull request #406 from j-koehler/master
add support for Ubuntu 22.04 (jammy)
2023-06-12 23:21:26 -05:00
Vlad von Hraban f00951fe73 Do not run php-fpm when ansible is in check mode 2023-05-22 14:50:07 +07:00
j.koehler d707b43c96 add support for Ubuntu 22.04 (jammy)
...and remove trusty from meta file since it is already no longer supported
2023-05-05 21:14:24 +02:00
Jeff Geerling 2a53885145 Fix Molecule CI workflow since docker plugin has moved. 2023-04-20 17:28:11 -05:00
Pieter Frenssen 73c526d073 Install the JSON extension on Debian for PHP 7.4 and below.
Starting with PHP 8.0 the JSON extension is part of the base package and cannot
be installed separately.

Fixes #358
2023-04-19 23:30:39 +03:00
Bartlomiej Sowa 7040702c5e fix with_flattened 2023-03-30 16:41:34 +02:00
Max Roeleveld 1f2349a5da
Fix variable name for pm.max_requests. 2023-03-17 12:28:34 +01:00
Jeff Geerling 153b163c25 Bump default version of PHP for RedHat systems. 2023-02-02 21:54:08 -06:00
Jeff Geerling 1cd65e086e Disable source CI install now. 2022-12-06 22:03:13 -06:00
Jeff Geerling bdf2ead5d3 Source build fix. 2022-12-06 19:54:05 -06:00
Jeff Geerling 8bb2869809 Use Debian for source install test. 2022-12-06 19:44:41 -06:00
Jeff Geerling 6f4af6ad63 Remove CentOS 7 from tests. 2022-12-06 19:35:43 -06:00
Jeff Geerling 9dd9cb38a1 Fix Molecule CI workflow for Ubuntu 22.04 GitHub Actions. 2022-12-06 18:24:32 -06:00
Jeff Geerling e38d788f1a Add role_name_check skipping to all molecule test suites. 2022-06-01 22:21:30 -05:00
Jeff Geerling 8c3bf4e1ac Bump CI test versions. 2022-03-07 10:24:14 -06:00
21 changed files with 97 additions and 105 deletions

57
.github/stale.yml vendored
View File

@ -1,57 +0,0 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 90
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 30
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels: []
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- bug
- pinned
- security
- planned
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: false
# Label to use when marking as stale
staleLabel: stale
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30
pulls:
markComment: |-
This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark pull requests as stale.
unmarkComment: >-
This pull request is no longer marked for closure.
closeComment: >-
This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.
issues:
markComment: |-
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
unmarkComment: >-
This issue is no longer marked for closure.
closeComment: >-
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

View File

@ -19,12 +19,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: 'geerlingguy.php'
- name: Set up Python 3.
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
@ -41,37 +41,34 @@ jobs:
strategy:
matrix:
include:
- distro: centos8
- distro: rockylinux8
playbook: converge.yml
- distro: centos7
- distro: ubuntu2204
playbook: converge.yml
- distro: ubuntu2004
playbook: converge.yml
- distro: ubuntu1804
- distro: debian12
playbook: converge.yml
- distro: debian11
playbook: converge.yml
- distro: debian10
playbook: converge.yml
- distro: debian9
playbook: converge.yml
- distro: centos7
playbook: source-install.yml
# Had some trouble, might fix later.
# - distro: debian11
# playbook: source-install.yml
steps:
- name: Check out the codebase.
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: 'geerlingguy.php'
- name: Set up Python 3.
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install test dependencies.
run: pip3 install ansible molecule[docker] docker
run: pip3 install ansible molecule molecule-plugins[docker] docker
- name: Run Molecule tests.
run: molecule test

View File

@ -22,12 +22,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: 'geerlingguy.php'
- name: Set up Python 3.
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'

34
.github/workflows/stale.yml vendored Normal file
View File

@ -0,0 +1,34 @@
---
name: Close inactive issues
'on':
schedule:
- cron: "55 10 * * 6" # semi-random time
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v8
with:
days-before-stale: 120
days-before-close: 60
exempt-issue-labels: bug,pinned,security,planned
exempt-pr-labels: bug,pinned,security,planned
stale-issue-label: "stale"
stale-pr-label: "stale"
stale-issue-message: |
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
close-issue-message: |
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
stale-pr-message: |
This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
close-pr-message: |
This pr has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -7,5 +7,4 @@ rules:
level: warning
ignore: |
.github/stale.yml
.travis.yml
.github/workflows/stale.yml

View File

@ -83,6 +83,7 @@ The handler restarts PHP-FPM by default. Setting the value to `reloaded` will re
pool_pm_min_spare_servers: 1
pool_pm_max_spare_servers: 3
pool_pm_max_requests: 500
pool_pm_status_path: /status
List of PHP-FPM pool to create. By default, www pool is created. To setup a new pool, add an item to php_fpm_pools list.

View File

@ -31,6 +31,7 @@ php_fpm_pm_start_servers: 5
php_fpm_pm_min_spare_servers: 5
php_fpm_pm_max_spare_servers: 5
php_fpm_pm_max_requests: 0
php_fpm_pm_status_path: ""
# PHP-FPM pool configuration.
php_fpm_pools:
@ -43,7 +44,8 @@ php_fpm_pools:
pool_pm_start_servers: "{{ php_fpm_pm_start_servers }}"
pool_pm_min_spare_servers: "{{ php_fpm_pm_min_spare_servers }}"
pool_pm_max_spare_servers: "{{ php_fpm_pm_max_spare_servers }}"
pool_php_fpm_pm_max_requests: "{{ php_fpm_pm_max_requests }}"
pool_pm_max_requests: "{{ php_fpm_pm_max_requests }}"
pool_pm_status_path: "{{ php_fpm_pm_status_path }}"
# The executable to run when calling PHP from the command line.
php_executable: "php"

View File

@ -13,3 +13,4 @@
when:
- php_enable_php_fpm
- php_fpm_state == 'started'
- not ansible_check_mode

View File

@ -7,12 +7,8 @@ galaxy_info:
description: PHP for RedHat/CentOS/Fedora/Debian/Ubuntu.
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 2.8
min_ansible_version: 2.10
platforms:
- name: EL
versions:
- 7
- 8
- name: Fedora
versions:
- all
@ -21,9 +17,7 @@ galaxy_info:
- all
- name: Ubuntu
versions:
- trusty
- xenial
- bionic
- all
galaxy_tags:
- development
- web

View File

@ -7,7 +7,7 @@
php_enable_webserver: false
php_enable_php_fpm: true
php_memory_limit: "192M"
php_enablerepo: "remi,remi-php70"
php_enablerepo: "remi,remi-php82"
php_install_recommends: false
handlers:
@ -17,21 +17,18 @@
pre_tasks:
- name: Update apt cache.
apt: update_cache=true cache_valid_time=600
apt:
update_cache: true
cache_valid_time: 600
when: ansible_os_family == 'Debian'
changed_when: false
# Ubuntu-specific tasks.
- name: Ensure dirmngr is installed (gnupg dependency).
apt:
name: dirmngr
state: present
when: ansible_os_family == 'Debian'
- name: Add repository for PHP 7.
apt_repository: repo='ppa:ondrej/php'
when: ansible_distribution == 'Ubuntu'
# Debian-specific tasks.
- name: Add dependencies for PHP versions (Debian).
apt:
@ -42,6 +39,11 @@
state: present
when: ansible_distribution == "Debian"
- name: Add Ondrej Sury's repo for PHP 8 (Ubuntu).
apt_repository:
repo: 'ppa:ondrej/php'
when: ansible_distribution == 'Ubuntu'
- name: Add Ondrej Sury's apt key (Debian).
apt_key:
url: https://packages.sury.org/php/apt.gpg

View File

@ -1,14 +1,18 @@
---
role_name_check: 1
dependency:
name: galaxy
options:
ignore-errors: true
driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-rockylinux8}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
provisioner:

View File

@ -50,4 +50,7 @@
name: "{{ php_fpm_daemon }}"
state: "{{ php_fpm_state }}"
enabled: "{{ php_fpm_enabled_on_boot }}"
when: php_enable_php_fpm and ansible_distribution != "Debian"
when:
- php_enable_php_fpm
- ansible_distribution != "Debian"
- not ansible_check_mode

View File

@ -1,16 +1,16 @@
---
- name: Ensure configuration directories exist.
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
follow: true
mode: 0755
with_flattened:
- "{{ php_conf_paths }}"
- "{{ php_extension_conf_paths }}"
with_items:
- "{{ php_conf_paths | flatten }}"
- "{{ php_extension_conf_paths | flatten }}"
- name: Place PHP configuration file in place.
template:
ansible.builtin.template:
src: php.ini.j2
dest: "{{ item }}/php.ini"
owner: root

View File

@ -54,7 +54,7 @@
- libfreetype6-dev
- libgmp3-dev
- libmcrypt-dev
- libmariadbclient-dev
- libmariadb-dev
- libpspell-dev
- librecode-dev
- libssl-dev

View File

@ -15,6 +15,16 @@
php_default_version_debian: "{{ __php_default_version_debian }}"
when: php_default_version_debian is not defined and ansible_os_family == 'Debian'
- name: Define the name of the JSON extension package on Debian for PHP <8.
set_fact:
__php_json_package_debian: "{{ 'php' + php_default_version_debian + '-json' }}"
when: ansible_os_family == 'Debian' and php_default_version_debian is version('8.0', '<')
- name: Add the JSON extension on Debian for PHP <8.
set_fact:
__php_packages: "{{ __php_packages + [__php_json_package_debian] }}"
when: __php_json_package_debian is defined and __php_json_package_debian not in __php_packages
- name: Define php_packages.
set_fact:
php_packages: "{{ __php_packages | list }}"

View File

@ -15,3 +15,6 @@ pm.start_servers = {{ item.pool_pm_start_servers | default(5, true) }}
pm.min_spare_servers = {{ item.pool_pm_min_spare_servers | default(5, true) }}
pm.max_spare_servers = {{ item.pool_pm_max_spare_servers | default(5, true) }}
pm.max_requests = {{ item.pool_pm_max_requests | default(500, true) }}
{% if item.pool_pm_status_path|length %}
pm.status_path = {{ item.pool_pm_status_path }}
{% endif %}

2
vars/Debian-12.yml Normal file
View File

@ -0,0 +1,2 @@
---
__php_default_version_debian: "8.2"

View File

@ -1,2 +0,0 @@
---
__php_default_version_debian: "7.0"

View File

@ -9,7 +9,6 @@ __php_packages:
- php{{ php_default_version_debian }}-gd
- php{{ php_default_version_debian }}-curl
- php{{ php_default_version_debian }}-imap
- php{{ php_default_version_debian }}-json
- php{{ php_default_version_debian }}-opcache
- php{{ php_default_version_debian }}-xml
- php{{ php_default_version_debian }}-mbstring

View File

@ -1,2 +0,0 @@
---
__php_default_version_debian: "7.0"

2
vars/Ubuntu-22.yml Normal file
View File

@ -0,0 +1,2 @@
---
__php_default_version_debian: "8.1"