first commit

This commit is contained in:
Ryan Cuda
2026-01-25 08:31:56 -07:00
commit 1234ef51c0
57 changed files with 2560 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
# phpinfo Role
This role installs Apache, PHP, and Firewalld, opens HTTP access, fixes SELinux
contexts, and deploys a PHP info page.
## Requirements
- RHEL / Rocky / Alma 9
- SELinux enforcing
- firewalld enabled
## Usage
```yaml
- hosts: web
become: true
roles:
- phpinfo

View File

@@ -0,0 +1,4 @@
---
phpinfo_webroot: /var/www/html
phpinfo_file: index.php

View File

@@ -0,0 +1,6 @@
---
- name: Restart httpd
ansible.builtin.service:
name: httpd
state: restarted

View File

@@ -0,0 +1,2 @@
install_date: 'Tue 30 Dec 2025 12:53:11 AM '
version: ''

View File

@@ -0,0 +1,22 @@
---
galaxy_info:
role_name: phpinfo
author: lab
description: Installs Apache, PHP, configures firewalld, fixes SELinux, and deploys a PHP info page
license: MIT
min_ansible_version: "2.9"
platforms:
- name: EL
versions:
- "9"
galaxy_tags:
- php
- httpd
- firewalld
- selinux
- web
dependencies: []

View File

@@ -0,0 +1,41 @@
---
- name: Install required packages
ansible.builtin.dnf:
name:
- httpd
- firewalld
- php
state: present
- name: Enable and start httpd
ansible.builtin.service:
name: httpd
state: started
enabled: true
- name: Enable and start firewalld
ansible.builtin.service:
name: firewalld
state: started
enabled: true
- name: Allow HTTP traffic through firewalld (persistent and immediate)
ansible.posix.firewalld:
service: http
state: enabled
permanent: true
immediate: true
- name: Fix SELinux context on webroot
ansible.builtin.command: restorecon -Rv {{ phpinfo_webroot }}
changed_when: false
- name: Deploy PHP info page
ansible.builtin.template:
src: index.php.j2
dest: "{{ phpinfo_webroot }}/{{ phpinfo_file }}"
owner: root
group: root
mode: '0644'
notify: Restart httpd

View File

@@ -0,0 +1,4 @@
<?php
phpinfo();
?>

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- phpinfo

View File

@@ -0,0 +1,2 @@
---
# vars file for phpinfo