Compare commits
40 Commits
Author | SHA1 | Date |
---|---|---|
Jeff Geerling | bf9bf9de00 | |
Jeff Geerling | bac5cdbe9b | |
Jeff Geerling | e66e110c5d | |
Jeff Geerling | f26da32537 | |
Jeff Geerling | 67c11836d4 | |
Jeff Geerling | f296994c76 | |
Jeff Geerling | d241f91947 | |
Jeff Geerling | 3c0a24606f | |
Jeff Geerling | bae936d2dc | |
Jeff Geerling | c942861308 | |
Jeff Geerling | 574b060aa4 | |
Jeff Geerling | 090b3d759a | |
Jeff Geerling | a42d3d4807 | |
Jeff Geerling | 421ce96755 | |
Jeff Geerling | 9bb3dc95b8 | |
Chris Deeming | 4db29a4139 | |
Jeff Geerling | 7c820847fe | |
Jeff Geerling | 7ea6036859 | |
Jeff Geerling | 6a9b4b66ad | |
Brian Wells | cab8a097c7 | |
Brian Wells | 6afb5eef00 | |
Brian Wells | 24cff502be | |
Brian Wells | e82190e1b0 | |
Brian Wells | ea9ee71842 | |
Brian Wells | 4203e796e6 | |
Brian Wells | 0974f94c37 | |
Jeff Geerling | d1fea7f256 | |
Jeff Geerling | bcb4a12a5e | |
Maxwell Gottlieb | 3562ade131 | |
Jeff Geerling | dbbc5421c1 | |
Jeff Geerling | 38f6713816 | |
Jeff Geerling | 7460ff2c19 | |
Jeff Geerling | 8d456ca374 | |
luminouw | 93f3fd3c34 | |
Jeff Geerling | 055cfd201b | |
Richard Steinbrück | 2c59b536e9 | |
Sergey Gripinskiy | 5b3cf3f760 | |
Jeff Geerling | aa60a3d85a | |
Jeff Geerling | 5a1d694eb0 | |
Jeff Geerling | d32913924e |
|
@ -1,4 +1,5 @@
|
|||
skip_list:
|
||||
- '306'
|
||||
- '503'
|
||||
- '106'
|
||||
- 'yaml'
|
||||
- 'risky-shell-pipe'
|
||||
- 'no-handler'
|
||||
- 'role-name'
|
||||
|
|
|
@ -1,56 +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:
|
||||
- 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.
|
|
@ -0,0 +1,90 @@
|
|||
---
|
||||
name: CI
|
||||
'on':
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
schedule:
|
||||
- cron: "30 6 * * 4"
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: 'geerlingguy.php-versions'
|
||||
|
||||
jobs:
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'geerlingguy.php-versions'
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install test dependencies.
|
||||
run: pip3 install yamllint
|
||||
|
||||
- name: Lint code.
|
||||
run: |
|
||||
yamllint .
|
||||
|
||||
molecule:
|
||||
name: Molecule
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# Default PHP version.
|
||||
- distro: rockylinux9
|
||||
playbook: converge.yml
|
||||
- distro: centos7
|
||||
playbook: converge.yml
|
||||
- distro: ubuntu2204
|
||||
playbook: converge.yml
|
||||
- distro: debian10
|
||||
playbook: converge.yml
|
||||
|
||||
# PHP 8.1.
|
||||
- distro: rockylinux8
|
||||
playbook: 8.1.yml
|
||||
- distro: ubuntu2004
|
||||
playbook: 8.1.yml
|
||||
- distro: debian10
|
||||
playbook: 8.1.yml
|
||||
|
||||
# PHP 7.4.
|
||||
- distro: rockylinux8
|
||||
playbook: 7.4.yml
|
||||
- distro: ubuntu2004
|
||||
playbook: 7.4.yml
|
||||
- distro: debian11
|
||||
playbook: 7.4.yml
|
||||
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'geerlingguy.php-versions'
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install test dependencies.
|
||||
run: pip3 install ansible molecule molecule-plugins[docker] docker
|
||||
|
||||
- name: Run Molecule tests.
|
||||
run: molecule test
|
||||
env:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
MOLECULE_DISTRO: ${{ matrix.distro }}
|
||||
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}
|
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
# This workflow requires a GALAXY_API_KEY secret present in the GitHub
|
||||
# repository or organization.
|
||||
#
|
||||
# See: https://github.com/marketplace/actions/publish-ansible-role-to-galaxy
|
||||
# See: https://github.com/ansible/galaxy/issues/46
|
||||
|
||||
name: Release
|
||||
'on':
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: 'geerlingguy.php-versions'
|
||||
|
||||
jobs:
|
||||
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'geerlingguy.php-versions'
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install Ansible.
|
||||
run: pip3 install ansible-core
|
||||
|
||||
- name: Trigger a new import on Galaxy.
|
||||
run: >-
|
||||
ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }}
|
||||
$(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)
|
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
name: Close inactive issues
|
||||
'on':
|
||||
schedule:
|
||||
- cron: "55 2 * * 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 }}
|
50
.travis.yml
50
.travis.yml
|
@ -1,50 +0,0 @@
|
|||
---
|
||||
language: python
|
||||
services: docker
|
||||
|
||||
env:
|
||||
global:
|
||||
- ROLE_NAME: php-versions
|
||||
matrix:
|
||||
# Default PHP version (7.3).
|
||||
- MOLECULE_DISTRO: centos8
|
||||
- MOLECULE_DISTRO: centos7
|
||||
- MOLECULE_DISTRO: ubuntu1804
|
||||
- MOLECULE_DISTRO: ubuntu1604
|
||||
- MOLECULE_DISTRO: debian10
|
||||
|
||||
# PHP 7.4.
|
||||
- MOLECULE_DISTRO: centos8
|
||||
MOLECULE_DOCKER_COMMAND: /usr/lib/systemd/systemd
|
||||
MOLECULE_PLAYBOOK: playbook-7.4.yml
|
||||
- MOLECULE_DISTRO: ubuntu1804
|
||||
MOLECULE_PLAYBOOK: playbook-7.4.yml
|
||||
- MOLECULE_DISTRO: debian10
|
||||
MOLECULE_PLAYBOOK: playbook-7.4.yml
|
||||
|
||||
# PHP 7.2.
|
||||
- MOLECULE_DISTRO: centos8
|
||||
MOLECULE_PLAYBOOK: playbook-7.2.yml
|
||||
- MOLECULE_DISTRO: ubuntu1804
|
||||
MOLECULE_PLAYBOOK: playbook-7.2.yml
|
||||
|
||||
before_install:
|
||||
# Upgrade Docker to work with docker-py.
|
||||
- curl https://gist.githubusercontent.com/geerlingguy/ce883ad4aec6a5f1187ef93bd338511e/raw/36612d28981d92863f839c5aefe5b7dd7193d6c6/travis-ci-docker-upgrade.sh | sudo bash
|
||||
|
||||
install:
|
||||
# Install test dependencies.
|
||||
- pip install molecule yamllint ansible-lint docker
|
||||
|
||||
before_script:
|
||||
# Use actual Ansible Galaxy role name for the project directory.
|
||||
- cd ../
|
||||
- mv ansible-role-$ROLE_NAME geerlingguy.$ROLE_NAME
|
||||
- cd geerlingguy.$ROLE_NAME
|
||||
|
||||
script:
|
||||
# Run tests.
|
||||
- molecule test
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
|
@ -7,4 +7,4 @@ rules:
|
|||
level: warning
|
||||
|
||||
ignore: |
|
||||
.github/stale.yml
|
||||
.github/workflows/stale.yml
|
||||
|
|
11
README.md
11
README.md
|
@ -1,6 +1,6 @@
|
|||
# Ansible Role: PHP Versions
|
||||
|
||||
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-php-versions.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-php-versions)
|
||||
[![CI](https://github.com/geerlingguy/ansible-role-php-versions/workflows/CI/badge.svg?event=push)](https://github.com/geerlingguy/ansible-role-php-versions/actions?query=workflow%3ACI)
|
||||
|
||||
Allows different PHP versions to be installed when using the `geerlingguy.php` role (or a similar role). This role was originally built for [Drupal VM](https://www.drupalvm.com) but was released more generically so others could use an easier mechanism for switching PHP versions.
|
||||
|
||||
|
@ -12,9 +12,9 @@ N/A
|
|||
|
||||
Available variables are listed below, along with default values (see `defaults/main.yml`):
|
||||
|
||||
php_version: '7.3'
|
||||
php_version: '8.2'
|
||||
|
||||
The PHP version to be installed. Any [currently-supported PHP major version](http://php.net/supported-versions.php) is a valid option (e.g. `7.2`, `7.3`, `7.4` etc.).
|
||||
The PHP version to be installed. Any [currently-supported PHP major version](http://php.net/supported-versions.php) is a valid option (e.g. `7.4`, `8.0`, `8.1`, or `8.2`).
|
||||
|
||||
php_versions_install_recommends: false
|
||||
|
||||
|
@ -28,12 +28,13 @@ The PHP version to be installed. Any [currently-supported PHP major version](htt
|
|||
## Example Playbook
|
||||
|
||||
- hosts: webservers
|
||||
become: true
|
||||
|
||||
vars:
|
||||
php_version: '7.3'
|
||||
php_version: '8.2'
|
||||
|
||||
roles:
|
||||
- role: geerlingguy.repo-remi
|
||||
- name: geerlingguy.repo-remi
|
||||
when: ansible_os_family == 'RedHat'
|
||||
- geerlingguy.php-versions
|
||||
- geerlingguy.php
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
# The PHP version to be installed.
|
||||
php_version: '7.3'
|
||||
php_version: '8.2'
|
||||
|
||||
# For Debian OSes only.
|
||||
php_versions_install_recommends: false
|
||||
|
|
|
@ -2,18 +2,14 @@
|
|||
dependencies: []
|
||||
|
||||
galaxy_info:
|
||||
# See: https://github.com/ansible/galaxy/issues/2393
|
||||
# role_name: php-versions
|
||||
role_name: php-versions
|
||||
author: geerlingguy
|
||||
description: Allows different PHP versions to be installed.
|
||||
company: "Midwestern Mac, LLC"
|
||||
license: "MIT"
|
||||
issue_tracker_url: https://github.com/geerlingguy/ansible-role-php-versions/issues
|
||||
min_ansible_version: 2.4
|
||||
min_ansible_version: 2.10
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- all
|
||||
- name: Debian
|
||||
versions:
|
||||
- all
|
||||
|
@ -22,6 +18,7 @@ galaxy_info:
|
|||
- trusty
|
||||
- xenial
|
||||
- bionic
|
||||
- jammy
|
||||
galaxy_tags:
|
||||
- php
|
||||
- web
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
vars:
|
||||
php_enable_webserver: false
|
||||
php_version: '7.2'
|
||||
php_version: '8.1'
|
||||
|
||||
pre_tasks:
|
||||
- name: Update apt cache.
|
|
@ -1,18 +1,18 @@
|
|||
---
|
||||
role_name_check: 1
|
||||
dependency:
|
||||
name: galaxy
|
||||
options:
|
||||
ignore-errors: true
|
||||
driver:
|
||||
name: docker
|
||||
lint: |
|
||||
set -e
|
||||
yamllint .
|
||||
ansible-lint
|
||||
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:
|
||||
|
|
|
@ -5,11 +5,18 @@
|
|||
- "{{ role_path }}/vars/{{ ansible_os_family }}.yml"
|
||||
- "{{ role_path }}/vars/{{ ansible_os_family }}-php{{ php_version }}.yml"
|
||||
|
||||
- name: Remove missing JSON extension for PHP 8.0 (included by default)
|
||||
set_fact:
|
||||
__php_packages: "{{ __php_packages | reject('search','php' + php_version + '-json') | list }}"
|
||||
when:
|
||||
- __php_packages is defined
|
||||
- php_version is version('8.0', '>=')
|
||||
|
||||
- name: Define PHP variables.
|
||||
set_fact: "{{ item.key }}={{ lookup('vars', item.value) }}"
|
||||
when:
|
||||
- hostvars[inventory_hostname][item.key] is undefined
|
||||
- hostvars[inventory_hostname][item.value] is defined
|
||||
- vars[item.key] is undefined
|
||||
- vars[item.value] is defined
|
||||
with_dict:
|
||||
php_conf_paths: __php_conf_paths
|
||||
php_extension_conf_paths: __php_extension_conf_paths
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
- name: Add Ondrej Sury's apt key (Debian).
|
||||
apt_key:
|
||||
url: https://packages.sury.org/php/apt.gpg
|
||||
id: 15058500A0235D97F5D10063B188E2B695BD4743
|
||||
state: present
|
||||
when: ansible_distribution == "Debian"
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
---
|
||||
# TODO: PHP 7.2 support will be removed soon. This is only being left in here as
|
||||
# a convenience for legacy PHP 7.2 users.
|
||||
- name: Enable remi repo for PHP 7.2.
|
||||
set_fact: php_enablerepo="remi,remi-php72"
|
||||
when: php_version == "7.2"
|
||||
|
@ -11,22 +13,32 @@
|
|||
set_fact: php_enablerepo="remi,remi-php74"
|
||||
when: php_version == "7.4"
|
||||
|
||||
- name: Enable remi repo for PHP 8.0.
|
||||
set_fact: php_enablerepo="remi,remi-php80"
|
||||
when: php_version == "8.0"
|
||||
|
||||
- name: Enable remi repo for PHP 8.1.
|
||||
set_fact: php_enablerepo="remi,remi-php81"
|
||||
when: php_version == "8.1"
|
||||
|
||||
- name: Enable remi repo for PHP 8.2.
|
||||
set_fact: php_enablerepo="remi,remi-php82"
|
||||
when: php_version == "8.2"
|
||||
|
||||
# See: https://github.com/ansible/ansible/issues/64852
|
||||
- block:
|
||||
|
||||
- name: Ensure dnf-plugins are installed on CentOS 8+.
|
||||
yum:
|
||||
name: dnf-plugins-core
|
||||
state: present
|
||||
- name: Ensure dnf-plugins are installed on CentOS 8+.
|
||||
yum:
|
||||
name: dnf-plugins-core
|
||||
state: present
|
||||
|
||||
- name: Enable DNF module for CentOS 8+.
|
||||
shell: |
|
||||
dnf config-manager --set-enabled PowerTools
|
||||
dnf module enable -y php:remi-{{ php_version }}
|
||||
args:
|
||||
warn: false
|
||||
register: dnf_module_enable
|
||||
changed_when: "'Nothing to do' not in dnf_module_enable.stdout"
|
||||
- name: Enable DNF module for CentOS 8+.
|
||||
shell: |
|
||||
dnf config-manager --set-enabled powertools
|
||||
dnf module enable -y php:remi-{{ php_version }}
|
||||
register: dnf_module_enable
|
||||
changed_when: "'Nothing to do' not in dnf_module_enable.stdout"
|
||||
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
|
|
|
@ -39,6 +39,9 @@ __php_packages:
|
|||
- "php{{ php_version }}-yaml"
|
||||
|
||||
php_versions_debian:
|
||||
# TODO: PHP 7.2 support will be removed soon. This is only being left in here as
|
||||
# a convenience for legacy PHP 7.2 users.
|
||||
- php7.2-common
|
||||
- php7.3-common
|
||||
- php7.4-common
|
||||
- php8.0-common
|
||||
|
|
Loading…
Reference in New Issue