Compare commits

...

14 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
Vlad von Hraban f00951fe73 Do not run php-fpm when ansible is in check mode 2023-05-22 14:50:07 +07: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
14 changed files with 75 additions and 83 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'
@ -47,8 +47,6 @@ jobs:
playbook: converge.yml
- distro: ubuntu2004
playbook: converge.yml
- distro: ubuntu1804
playbook: converge.yml
- distro: debian12
playbook: converge.yml
- distro: debian11
@ -60,12 +58,12 @@ jobs:
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'

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,11 +7,8 @@ galaxy_info:
description: PHP for RedHat/CentOS/Fedora/Debian/Ubuntu.
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 2.9
min_ansible_version: 2.10
platforms:
- name: EL
versions:
- all
- name: Fedora
versions:
- all

View File

@ -17,13 +17,17 @@
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
- name: Add repository for PHP 8.
apt_repository: repo='ppa:ondrej/php'
when: ansible_distribution == 'Ubuntu'
- name: Ensure dirmngr is installed (gnupg dependency).
apt:
name: dirmngr
state: present
when: ansible_os_family == 'Debian'
# Debian-specific tasks.
- name: Add dependencies for PHP versions (Debian).
@ -35,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

@ -2,11 +2,13 @@
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:rw

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

@ -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 %}