Files
osticket-ansible/roles/php/tasks/main.yml
T
Claude Sonnet 5 7320b8da8d Restore from Gitea ZIP snapshot (12.08.2026) after full instance reinstall
Git history was lost when the previous Gitea instance was wiped and
reinstalled due to an unresolved corruption bug — this commit is the
last known-good file content, exported before the reinstall. Prior
commit history is not recoverable through this path.
2026-08-12 19:23:57 +00:00

47 lines
1.2 KiB
YAML

---
- name: Install prerequisite packages for PHP repository
ansible.builtin.apt:
name:
- ca-certificates
- curl
- gpg
state: present
- name: Add PHP repository key (Ondrej)
ansible.builtin.shell: |
curl -fsSL https://packages.sury.org/php/apt.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/sury-php.gpg
args:
creates: /etc/apt/trusted.gpg.d/sury-php.gpg
- name: Add PHP repository
ansible.builtin.apt_repository:
repo: "deb https://packages.sury.org/php/ {{ ansible_facts['lsb']['codename'] }} main"
state: present
update_cache: yes
- name: Install PHP 8.4 and extensions
ansible.builtin.apt:
name:
- php8.4
- libapache2-mod-php8.4
- php8.4-mysql
- php8.4-cli
- php8.4-curl
- php8.4-gd
- php8.4-mbstring
- php8.4-xml
- php8.4-zip
- php8.4-intl
- php8.4-bcmath
- php8.4-imap
state: present
notify: Restart Apache
- name: Set index.php priority
ansible.builtin.lineinfile:
path: /etc/apache2/mods-enabled/dir.conf
regexp: '^(\s*DirectoryIndex)'
line: '\1 index.php index.html index.cgi index.pl index.xhtml index.htm'
backrefs: yes
notify: Restart Apache