-
-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zentral ansible role? #25
Comments
Just say if busy, in the plan, not coming or whatever. Thanks |
Sorry for the late reply. We don't have a Zentral ansible role. |
Pushed a first review https://github.com/juju4/ansible-zentral I would appreciate a bit of guidance, especially as it seems, I need to setup a specific daemon for simplesamlphp. right? Thanks |
Quick tips and review.
|
It's not that simple having many dependencies and daemons. On the setup, I installed all daemons except promotheus but at this point zentral gunicorn or workers are not launching correctly. I also added redis because I thought it was needed but doesn't seem so.
If I launch manually from zentral all-in-one vagrant the zentral_worker
|
Zentral runs on python >= 3.4. I think that’s the issue.
… On 16 Apr 2017, at 23:41, Julien ***@***.***> wrote:
It's not that simple having many dependencies and daemons.
Was already playing a lot with the vagrant all in one but as image, they hide complexity and partly the understanding of the innerwork of zentral.
Documented post-install is done properly I think. That's more what is in image and less documented which is harder
On the setup, I installed all daemons except promotheus but at this point zentral gunicorn or workers are not launching correctly. I also added redis because I thought it was needed but doesn't seem so.
$ /usr/bin/python server/manage.py runserver runworkers
Traceback (most recent call last):
File "server/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 316, in execute
settings.INSTALLED_APPS
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 97, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/var/_zentral/zentral/server/server/settings.py", line 19, in <module>
from zentral.conf import saml2_idp_metadata_file, settings as zentral_settings
File "/var/_zentral/zentral/zentral/conf/__init__.py", line 3, in <module>
from .utils import find_conf_file, load_config_file
File "/var/_zentral/zentral/zentral/conf/utils.py", line 37
raise ImproperlyConfigured("{} error in file {}".format(filetype, filepath)) from None
^
SyntaxError: invalid syntax
$ python -mjson.tool ../conf/start/zentral/base.json
[OK]
$ /usr/local/bin/gunicorn --chdir /var/_zentral/zentral/server -b 0.0.0.0:8000 -w 4 --access-logfile /var/log/zentral/gunicorn.log --error-logfile /var/log/zentral/gunicorn.err server.wsgi
Traceback (most recent call last):
File "/usr/local/bin/gunicorn", line 11, in <module>
sys.exit(run())
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 74, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 203, in run
super(Application, self).run()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 72, in run
Arbiter(self).run()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 231, in run
self.halt(reason=inst.reason, exit_status=inst.exit_status)
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 344, in halt
self.stop()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 393, in stop
time.sleep(0.1)
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 244, in handle_chld
self.reap_workers()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 524, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
If I launch manually from zentral all-in-one vagrant the zentral_worker
***@***.***:/home/zentral/app/releases/current$ sudo -H -u zentral /home/zentral/app/venv/bin/python server/manage.py runworkers
Traceback (most recent call last):
File "server/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/zentral/app/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/zentral/app/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 316, in execute
settings.INSTALLED_APPS
File "/home/zentral/app/venv/lib/python3.5/site-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/home/zentral/app/venv/lib/python3.5/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/home/zentral/app/venv/lib/python3.5/site-packages/django/conf/__init__.py", line 97, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/zentral/app/releases/2017.03.02-19.36.11-master-b98066/server/server/settings.py", line 19, in <module>
from zentral.conf import saml2_idp_metadata_file, settings as zentral_settings
File "/home/zentral/app/releases/2017.03.02-19.36.11-master-b98066/zentral/conf/__init__.py", line 38, in <module>
settings = load_config_file(find_conf_file(conf_dir, "base"))
File "/home/zentral/app/releases/2017.03.02-19.36.11-master-b98066/zentral/conf/utils.py", line 12, in find_conf_file
raise ImproperlyConfigured('{} is required'.format(' or '.join(filepaths)))
zentral.core.exceptions.ImproperlyConfigured: ('/home/zentral/app/releases/2017.03.02-19.36.11-master-b98066/conf/base.json or /home/zentral/app/releases/2017.03.02-19.36.11-master-b98066/conf/base.yml is required', None)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
You also need to use the ZENTRAL_CONF_DIR env var. It must point to the directory containing the base.json file. Otherwise zentral will look in the ./conf/ sub dir in the code directory.
… On 16 Apr 2017, at 23:46, Éric Falconnier ***@***.***> wrote:
Zentral runs on python >= 3.4. I think that’s the issue.
> On 16 Apr 2017, at 23:41, Julien ***@***.***> wrote:
>
> It's not that simple having many dependencies and daemons.
> Was already playing a lot with the vagrant all in one but as image, they hide complexity and partly the understanding of the innerwork of zentral.
> Documented post-install is done properly I think. That's more what is in image and less documented which is harder
>
> On the setup, I installed all daemons except promotheus but at this point zentral gunicorn or workers are not launching correctly. I also added redis because I thought it was needed but doesn't seem so.
>
> $ /usr/bin/python server/manage.py runserver runworkers
> Traceback (most recent call last):
> File "server/manage.py", line 10, in <module>
> execute_from_command_line(sys.argv)
> File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
> utility.execute()
> File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 316, in execute
> settings.INSTALLED_APPS
> File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 53, in __getattr__
> self._setup(name)
> File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 41, in _setup
> self._wrapped = Settings(settings_module)
> File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 97, in __init__
> mod = importlib.import_module(self.SETTINGS_MODULE)
> File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
> __import__(name)
> File "/var/_zentral/zentral/server/server/settings.py", line 19, in <module>
> from zentral.conf import saml2_idp_metadata_file, settings as zentral_settings
> File "/var/_zentral/zentral/zentral/conf/__init__.py", line 3, in <module>
> from .utils import find_conf_file, load_config_file
> File "/var/_zentral/zentral/zentral/conf/utils.py", line 37
> raise ImproperlyConfigured("{} error in file {}".format(filetype, filepath)) from None
> ^
> SyntaxError: invalid syntax
>
> $ python -mjson.tool ../conf/start/zentral/base.json
> [OK]
> $ /usr/local/bin/gunicorn --chdir /var/_zentral/zentral/server -b 0.0.0.0:8000 -w 4 --access-logfile /var/log/zentral/gunicorn.log --error-logfile /var/log/zentral/gunicorn.err server.wsgi
> Traceback (most recent call last):
> File "/usr/local/bin/gunicorn", line 11, in <module>
> sys.exit(run())
> File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 74, in run
> WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
> File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 203, in run
> super(Application, self).run()
> File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 72, in run
> Arbiter(self).run()
> File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 231, in run
> self.halt(reason=inst.reason, exit_status=inst.exit_status)
> File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 344, in halt
> self.stop()
> File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 393, in stop
> time.sleep(0.1)
> File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 244, in handle_chld
> self.reap_workers()
> File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 524, in reap_workers
> raise HaltServer(reason, self.WORKER_BOOT_ERROR)
> gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
>
> If I launch manually from zentral all-in-one vagrant the zentral_worker
>
> ***@***.***:/home/zentral/app/releases/current$ sudo -H -u zentral /home/zentral/app/venv/bin/python server/manage.py runworkers
> Traceback (most recent call last):
> File "server/manage.py", line 10, in <module>
> execute_from_command_line(sys.argv)
> File "/home/zentral/app/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
> utility.execute()
> File "/home/zentral/app/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 316, in execute
> settings.INSTALLED_APPS
> File "/home/zentral/app/venv/lib/python3.5/site-packages/django/conf/__init__.py", line 53, in __getattr__
> self._setup(name)
> File "/home/zentral/app/venv/lib/python3.5/site-packages/django/conf/__init__.py", line 41, in _setup
> self._wrapped = Settings(settings_module)
> File "/home/zentral/app/venv/lib/python3.5/site-packages/django/conf/__init__.py", line 97, in __init__
> mod = importlib.import_module(self.SETTINGS_MODULE)
> File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
> File "<frozen importlib._bootstrap>", line 986, in _gcd_import
> File "<frozen importlib._bootstrap>", line 969, in _find_and_load
> File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
> File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
> File "<frozen importlib._bootstrap_external>", line 665, in exec_module
> File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
> File "/home/zentral/app/releases/2017.03.02-19.36.11-master-b98066/server/server/settings.py", line 19, in <module>
> from zentral.conf import saml2_idp_metadata_file, settings as zentral_settings
> File "/home/zentral/app/releases/2017.03.02-19.36.11-master-b98066/zentral/conf/__init__.py", line 38, in <module>
> settings = load_config_file(find_conf_file(conf_dir, "base"))
> File "/home/zentral/app/releases/2017.03.02-19.36.11-master-b98066/zentral/conf/utils.py", line 12, in find_conf_file
> raise ImproperlyConfigured('{} is required'.format(' or '.join(filepaths)))
> zentral.core.exceptions.ImproperlyConfigured: ('/home/zentral/app/releases/2017.03.02-19.36.11-master-b98066/conf/base.json or /home/zentral/app/releases/2017.03.02-19.36.11-master-b98066/conf/base.yml is required', None)
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
|
I added ZENTRAL_CONF_DIR in systemd conf files and in /etc/profile.
gunicorn seems fine with python3 but web interface gets
most probably because shell user is _zentral... |
Look in the docker-entrypoint.sh script for examples how to use the different management commands. |
I looked at docker-entrypoint when starting. Just need to review those services once fixed, just a relationship warning and web interface is up
|
You need to run the Django This is done too in the docker-entrypoint.py script. |
ok. I put it aside because I was not sure it mapped I also change server/settings.py to match customized pgsql db/user/pass. Any option to set user password in an unattended way? One thing to clarify. the gunicorn and manage.py runserver are the same? Thanks |
|
perfect. removing it. will review the rest this weekend. |
Following this thread :) |
Hello
Thanks a lot for your work.
I look at the repo, the other ones from same user and ansible galaxy but I didn't find the role(s) to setup zentral.
I'm interested in the tool but I would go more to other cloud like digitalocean or Azure.
Roles should make it easy but where?
Thanks a lot!
The text was updated successfully, but these errors were encountered: