Add nocc command
This commit is contained in:
parent
f1c816cba1
commit
3315e17346
3 changed files with 53 additions and 8 deletions
|
@ -113,16 +113,25 @@ define sunetdrive::app_type (
|
||||||
minute => '*/5',
|
minute => '*/5',
|
||||||
}
|
}
|
||||||
file { '/opt/nextcloud/user-sync.sh':
|
file { '/opt/nextcloud/user-sync.sh':
|
||||||
ensure => file,
|
ensure => absent,
|
||||||
owner => 'root',
|
|
||||||
group => 'root',
|
|
||||||
mode => '0700',
|
|
||||||
content => template('sunetdrive/application/user-sync.erb.sh'),
|
|
||||||
}
|
}
|
||||||
-> cron { 'gss_user_sync':
|
-> cron { 'gss_user_sync':
|
||||||
command => '/opt/nextcloud/user-sync.sh',
|
ensure => absent,
|
||||||
user => 'root',
|
}
|
||||||
minute => '*/5',
|
file { '/usr/local/bin/nocc':
|
||||||
|
ensure => present,
|
||||||
|
force => true,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
content => template('sunetdrive/application/nocc.erb'),
|
||||||
|
mode => '0740',
|
||||||
|
}
|
||||||
|
file { '/etc/sudoers.d/99-nocc':
|
||||||
|
ensure => file,
|
||||||
|
content => "script ALL=(root) NOPASSWD: /usr/local/bin/nocc\n",
|
||||||
|
mode => '0440',
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
}
|
}
|
||||||
file { '/usr/local/bin/occ':
|
file { '/usr/local/bin/occ':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
|
|
|
@ -40,6 +40,21 @@ class sunetdrive::multinode (
|
||||||
user { 'www-data': ensure => present, system => true }
|
user { 'www-data': ensure => present, system => true }
|
||||||
sunet::system_user {'mysql': username => 'mysql', group => 'mysql' }
|
sunet::system_user {'mysql': username => 'mysql', group => 'mysql' }
|
||||||
ensure_resource('file', '/opt/nextcloud' , { ensure => directory, recurse => true } )
|
ensure_resource('file', '/opt/nextcloud' , { ensure => directory, recurse => true } )
|
||||||
|
file { '/usr/local/bin/nocc':
|
||||||
|
ensure => present,
|
||||||
|
force => true,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
content => template('sunetdrive/application/nocc.erb'),
|
||||||
|
mode => '0740',
|
||||||
|
}
|
||||||
|
file { '/etc/sudoers.d/99-nocc':
|
||||||
|
ensure => file,
|
||||||
|
content => "script ALL=(root) NOPASSWD: /usr/local/bin/nocc\n",
|
||||||
|
mode => '0440',
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
}
|
||||||
file { '/usr/local/bin/occ':
|
file { '/usr/local/bin/occ':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
force => true,
|
force => true,
|
||||||
|
|
21
templates/application/nocc.erb
Executable file
21
templates/application/nocc.erb
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ "${1}" =~ ^nextcloud ]]; then
|
||||||
|
container=${1}
|
||||||
|
shift
|
||||||
|
else
|
||||||
|
container="nextcloud_app_1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
oc_list=$(env| grep 'OC_')
|
||||||
|
if [[ "x${oc_list}" != "x" ]]; then
|
||||||
|
for row in $(echo "${oc_list}"); do
|
||||||
|
MY_VARS="${MY_VARS} -e ${row}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker exec -ti ${MY_VARS} -u www-data ${container} php --define apc.enable_cli=1 /var/www/html/occ "$@"
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue