Skip to content
This repository was archived by the owner on May 27, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lamp-php/lamp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
phpinfo();
?>
74 changes: 74 additions & 0 deletions lamp-php/lamp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
- hosts: all
become: yes
vars:
- packages:
- ubuntu-mate-core
- ubuntu-mate-desktop
- xrdp

tasks:
- name: installing apache2
apt:
name: apache2
update_cache: yes
state: present
notify:
- restart apache
when: ansible_os_family == "Debian"

- name: "installing depedencies"
apt:

pkg: "{{ packages }}"
state: present
- name: download webpage
get_url:
url: https://raw.githubusercontent.com/asquarezone/AnsibleZone/master/ClassRoomExamples/July2018/basics/info.php
dest: /var/www/html/lamp.php


- name: install httpd
yum:
name: httpd
state: present
notify:
- restart httpd
when: ansible_os_family == "Redhat"

- name: installing php
apt:
name: "{{ item }}"
state: present
with_items:
- php
- libapache2-mod-php
- php-mcrypt
- php-mysql
notify:
- restart apache
when: ansible_os_family == "Debian"

- name: install php
yum:
name: "{{ item }}"
state: present
with_items:
- php
- php-mysql
notify:
- restart httpd
when: ansible_os_family == "Redhat"

handlers:
- name: restart apache
service:
name: apache2
state: restarted
when: ansible_os_family == "Debian"

- name: restart httpd
service:
name: httpd
state: restarted
when: ansible_os_family == "Redhat"