made lamp role more generic

This commit is contained in:
2024-12-04 11:11:17 +01:00
parent 8074187173
commit 7f50fbd7e0
6 changed files with 39 additions and 36 deletions

View File

@@ -0,0 +1,4 @@
site_conf: example.com.conf
php_verison: "8.4"
mysql_db_name: mysql
mysql_db_user: mysql

View File

@@ -15,8 +15,8 @@
- name: Add Apache virtualhost for Owncloud
template:
src: "templates/owncloud.dav.conf.j2"
dest: "/etc/apache2/sites-available/owncloud.dav.conf"
src: "templates/{{ site_conf }}.j2"
dest: "/etc/apache2/sites-available/{{ site_conf }}"
owner: root
group: root
mode: 0644
@@ -25,7 +25,7 @@
- name: Enable the ownCloud site.
command: >
a2ensite owncloud.dav
creates=/etc/apache2/sites-enabled/owncloud.dav.conf
creates="/etc/apache2/sites-enabled/{{ site_conf }}"
notify: restart apache
- name: Disable the default site.

View File

@@ -26,26 +26,26 @@
- mariadb-server
- libpcre3-dev
- apache2
- libapache2-mod-php7.4
- php7.4
- php7.4-imagick
- php7.4-common
- php7.4-curl
- php7.4-gd
- php7.4-imap
- php7.4-intl
- php7.4-json
- php7.4-mbstring
- php7.4-gmp
- php7.4-bcmath
- php7.4-mysql
- php7.4-ssh2
- php7.4-xml
- php7.4-zip
- php7.4-apcu
- php7.4-redis
- php7.4-ldap
- php7.4-smbclient
- "libapache2-mod-php{{ php_version }}"
- "php{{ php_version }}"
- "php{{ php_version }}-imagick"
- "php{{ php_version }}-common"
- "php{{ php_version }}-curl"
- "php{{ php_version }}-gd"
- "php{{ php_version }}-imap"
- "php{{ php_version }}-intl"
- "php{{ php_version }}-json"
- "php{{ php_version }}-mbstring"
- "php{{ php_version }}-gmp"
- "php{{ php_version }}-bcmath"
- "php{{ php_version }}-mysql"
- "php{{ php_version }}-ssh2"
- "php{{ php_version }}-xml"
- "php{{ php_version }}-zip"
- "php{{ php_version }}-apcu"
- "php{{ php_version }}-redis"
- "php{{ php_version }}-ldap"
- "php{{ php_version }}-smbclient"
- php-phpseclib
- bzip2
- rsync

View File

@@ -1,16 +1,16 @@
- name: Create a MySQL database for ownCloud.
- name: Create a MySQL database.
community.mysql.mysql_db:
name: owncloud
name: "{{ mysql_db_name }}"
state: present
login_unix_socket: /run/mysqld/mysqld.sock
- name: Create a MySQL db user for ownCloud.
- name: Create a MySQL db user.
community.mysql.mysql_user:
name: "owncloud"
name: "{{ mysql_db_user }}"
password: "{{ mysql_passwd }}"
login_user: "root"
login_password: "{{ mysql_passwd }}"
priv: "owncloud.*:ALL"
priv: "{{ mysql_db_user }}.*:ALL"
host: localhost
state: present
login_unix_socket: /run/mysqld/mysqld.sock

View File

@@ -6,11 +6,10 @@
line: "opcache.memory_consumption = 96"
state: present
notify: restart apache
- name: Adjust smbclient setting.
template:
src: "templates/smbclient.ini.j2"
dest: "/etc/php/7.4/mods-available/smbclient.ini"
owner: root
group: root
notify: restart apache
#- name: Adjust smbclient setting.
# template:
# src: "templates/smbclient.ini.j2"
# dest: "/etc/php/7.4/mods-available/smbclient.ini"
# owner: root
# group: root
# notify: restart apache

View File