-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix/issue-62'. Merge #79.
- Loading branch information
Showing
9 changed files
with
97 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ debops.owncloud - Install and manage ownCloud instances | |
|
||
Copyright (C) 2015-2016 Maciej Delmanowski <[email protected]> | ||
Copyright (C) 2015 Hartmut Goebel <[email protected]> | ||
Copyright (C) 2015-2016 Robin Schneider <[email protected]> | ||
Copyright (C) 2015-2016 DebOps https://debops.org/ | ||
Copyright (C) 2015-2017 Robin Schneider <[email protected]> | ||
Copyright (C) 2015-2017 DebOps https://debops.org/ | ||
|
||
This Ansible role is part of DebOps. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../templates/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,38 @@ | ||
{{ ({ | ||
"enabled": "true", | ||
"webserver": owncloud__webserver|string, | ||
"release": owncloud__release|string, | ||
"variant": owncloud__variant|string, | ||
"auto_security_updates_enabled": owncloud__auto_security_updates_enabled|bool, | ||
}) | to_nice_json }} | ||
#!/usr/bin/env python | ||
|
||
# {{ ansible_managed }} | ||
|
||
from __future__ import print_function | ||
import os | ||
from json import loads, dumps | ||
import subprocess | ||
|
||
output = loads('''{{ ({ | ||
"enabled": (owncloud__deploy_state == "present"), | ||
"webserver": owncloud__webserver|string, | ||
"variant": owncloud__variant|string, | ||
"auto_security_updates_enabled": owncloud__auto_security_updates_enabled|bool, | ||
}) | to_nice_json }}''') | ||
|
||
|
||
if os.path.isfile('/var/www/owncloud/config/config.php'): | ||
try: | ||
config_cmd = subprocess.Popen( | ||
['php', '-r', 'include "/var/www/owncloud/config/config.php"; echo json_encode($CONFIG);'], | ||
stdout=subprocess.PIPE, | ||
stderr=subprocess.PIPE, | ||
) | ||
except: | ||
pass | ||
else: | ||
std_out, std_err = config_cmd.communicate() | ||
|
||
if config_cmd.returncode == 0 and len(std_err) == 0: | ||
config = loads(std_out) | ||
for key in ['instanceid', 'version', 'updatechecker', 'theme', 'maintenance', 'datadirectory', 'trusted_domains']: | ||
output[key] = config[key] | ||
|
||
if 'version' in output: | ||
output['release'] = '.'.join(output['version'].split('.')[:2]) | ||
|
||
print(dumps(output, sort_keys=True, indent=2)) |