Commit 89129a75 authored by Matthieu FAURE's avatar Matthieu FAURE

FEAT Add NextCloud

parent 130b380e
Pipeline #6189 failed with stages
in 2 minutes and 36 seconds
......@@ -29,7 +29,12 @@ If there's more that they should know about, though, this is the place to mentio
* Dependencies that your module automatically installs.
* Warnings or other important notices.
### Setup Requirements **OPTIONAL**
### Setup Requirements
Hard dependencies:
* puppetlabs/stdlib >= 4.13.1
* puppet/archive >= 4.2.0
Soft dependencies:
......
......@@ -8,11 +8,13 @@
# @param apache_docroot If manage_apache: absolute path for virtual host document root
# @param apache_default_vhost Define the created vhost as the default one
# @param php_version If manage_apache: PHP version to install
# @param manage_redis Whether to install Redis
#
# @example
# include nextcloud
class nextcloud (
String $mariadb_password,
String $nextcloud_version = 'latest',
Boolean $manage_apache = false,
Stdlib::Host $apache_hostname = 'nextcloud.example.org',
Stdlib::Port $apache_port = 80,
......@@ -28,6 +30,12 @@ class nextcloud (
String $mariadb_database = 'nextcloud',
) {
# Local variable
$nc_download_URL_base = 'https://download.nextcloud.com/server/releases'
# TODO manage possible formats of $nextcloud_version: 'latest.tar.bz2', 'nextcloud-16.0.5.tar.bz2'...
$nc_archive="${nextcloud_version}.tar.bz2"
$nc_archive_URL="${nc_download_URL_base}/${nc_archive}"
# Install Apache + PHP-FPM and configure vhost
if $manage_apache {
......@@ -107,7 +115,14 @@ class nextcloud (
host => $mariadb_hostname,
grant => ['ALL'],
}
}
# Get Nextcloud archive
archive { 'download-nextcloud-archive':
ensure => 'present',
# TODO allow to define where archive should be extracted (maybe outside Apache's scope)
path => "${apache_docroot}/${nc_archive}",
source => $nc_archive_URL,
}
# TODO configure APCu + Redis in NextCloud.
......
......@@ -9,6 +9,10 @@
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.13.1 < 7.0.0"
},
{
"name": "puppet/archive",
"version_requirement": ">= 4.2.0 < 5.0.0"
}
],
"operatingsystem_support": [
......
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