Commit 9be545b4 authored by Ing. Matej Madeja's avatar Ing. Matej Madeja
Browse files

final centos 8 solution

parent 18b57268
---
# defaults file for lamp
\ No newline at end of file
# defaults file for lamp
apt_pkgs:
- apache2
- php7.3
- php7.3-mysql
- mariadb-server
- mariadb-client
dnf_pkgs:
- httpd
- php
- php-mysqlnd
- mariadb-server
- mariadb
# based on https://www.itzgeek.com/how-tos/linux/centos-how-tos/how-to-install-php-7-3-on-rhel-8.html
- name: "Install prerequisities"
become: yes
dnf:
name:
- epel-release
- yum-utils
- https://rpms.remirepo.net/enterprise/remi-release-8.rpm
state: present
update_cache: yes
- name: "Enable DNF module"
shell:
cmd: "dnf module enable -y php:remi-7.3"
- name: "Install php"
become: yes
dnf:
name: "{{ dnf_pkgs }}"
state: present
update_cache: yes
- name: "Start services"
service:
name: "{{ item }}"
state: started
enabled: yes
become: yes
with_items:
- httpd
- mariadb
......@@ -12,3 +12,8 @@
- name: "Add to source list"
shell: "echo \"deb https://packages.sury.org/php/ $(lsb_release -sc) main\" | tee /etc/apt/sources.list.d/php7.3.list"
- name: "Install packages"
apt:
pkg: "{{ apt_pkgs }}"
update_cache: yes
- name: "Add ppa:ondrej/php repo"
become: yes
apt_repository:
repo: "ppa:ondrej/php"
\ No newline at end of file
repo: "ppa:ondrej/php"
- name: "Install packages"
apt:
pkg: "{{ apt_pkgs }}"
update_cache: yes
\ No newline at end of file
......@@ -6,14 +6,7 @@
pkg:
- software-properties-common
update_cache: yes
- debug:
var: ansible_os_family
tags: debug
- debug:
var: ansible_distribution
tags: debug
when: ansible_os_family == 'Debian'
- include: Ubuntu.yml
when: ansible_distribution == 'Ubuntu'
......@@ -21,15 +14,8 @@
- include: Debian.yml
when: ansible_distribution == 'Debian'
- name: "Install packages"
apt:
pkg:
- apache2
- php7.3
- php7.3-mysql
- mariadb-server
- mariadb-client
update_cache: yes
- include: CentOS.yml
when: ansible_distribution == 'CentOS'
# - name: "Deploy index.html"
# become: yes
......@@ -61,9 +47,5 @@
tags:
- files
- debug:
var: role_path
tags:
- files
become: yes
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment