Commit 8d820127 authored by Matthieu FAURE's avatar Matthieu FAURE

Merge branch '8-set-apache-document_root-to-var-www-nextcloud' into 'master'

Resolve "Set Apache document_root to /var/www/nextcloud"

Closes #9 and #8

See merge request !5
parents f2ce1e58 f15eca92
Pipeline #6381 passed with stages
in 10 minutes and 54 seconds
......@@ -5,8 +5,9 @@
# @param nc_admin_username Username of NextCloud administrator
# @param nc_admin_password Password of NextCloud administrator
# @param nc_install_parent_dir
# Absolute directory where NextCloud archive will be extracted. By design, a 'nextcloud' directory is created
# @param nc_install_datadir Absolute directory where NextCloud data will be stored
# Absolute directory where NextCloud archive will be extracted. By design, a 'nextcloud' directory is created
# @param nc_data_parent_dir
# Absolute directory where NextCloud data will be stored. A `data/` subdir will be created
# @param manage_apache Whether to install Apache
# @param apache_hostname If manage_apache: Hostname for the virtual host to be create
# @param apache_port If manage_apache: port Apache will listen to
......@@ -28,8 +29,8 @@ class nextcloud (
String $db_password,
String $nc_admin_username,
String $nc_admin_password,
Stdlib::Absolutepath $nc_install_parent_dir = '/var/lib/',
Stdlib::Absolutepath $nc_datadir = '/mnt/data',
Stdlib::Absolutepath $nc_install_parent_dir = '/var/www',
Stdlib::Absolutepath $nc_data_parent_dir = '/var/lib/nextcloud',
String $nc_version = 'latest',
Boolean $manage_apache = false,
Stdlib::Host $apache_hostname = 'nextcloud.example.org',
......@@ -53,6 +54,7 @@ class nextcloud (
$nc_archive = "${nc_version}.tar.bz2"
$nc_archive_url = "${nc_download_url_base}/${nc_archive}"
$nc_install_dir = "${nc_install_parent_dir}/nextcloud" # hardcoded because archive extracts in a 'nextcloud' dir
$nc_data_dir = "${nc_data_parent_dir}/data"
# Install Apache + PHP-FPM and configure vhost
if $manage_apache {
......@@ -136,7 +138,10 @@ class nextcloud (
}
# Create NextCloud directory
file { $nc_install_dir:
file { $nc_install_parent_dir:
ensure => directory,
}
-> file { $nc_install_dir:
ensure => directory,
owner => $apache_user,
group => $apache_user,
......@@ -144,7 +149,10 @@ class nextcloud (
}
# Create NextCloud *data* directory
file { $nc_datadir:
file { $nc_data_parent_dir:
ensure => directory,
}
-> file { $nc_data_dir:
ensure => directory,
owner => $apache_user,
group => $apache_user,
......
......@@ -44,10 +44,10 @@ describe 'NextCloud class' do
describe service('apache2') do
it { is_expected.to be_running }
end
describe file('/var/lib/nextcloud/index.php') do
describe file('/var/www/nextcloud/index.php') do
it { is_expected.to be_file }
end
describe file('/var/lib/nextcloud/core/') do
describe file('/var/www/nextcloud/core/') do
it { is_expected.to be_directory }
end
......
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