Skip to content
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

Agent setup fails in "debops.authorized_keys : Enforce state of authorized_keys user files" #27

Open
ganto opened this issue Jan 26, 2017 · 0 comments
Labels

Comments

@ganto
Copy link
Member

ganto commented Jan 26, 2017

A playbook run would abort with an error like:

TASK [debops.authorized_keys : Enforce state of authorized_keys user files] ****
failed: [cmk02] (item={u'key_options': u'command="/usr/bin/sudo /usr/bin/check_mk_agent"', u'group': u'checkmk', u'options': [u'no-agent-forwarding', u'no-port-forwardin
g', u'no-X11-forwarding', u'no-pty', u'no-user-rc'], u'name': u'checkmk', u'sshkeys': [u'']}) => {"failed": true, "item": {"group": "checkmk", "key_options": "command=\"
/usr/bin/sudo /usr/bin/check_mk_agent\"", "name": "checkmk", "options": ["no-agent-forwarding", "no-port-forwarding", "no-X11-forwarding", "no-pty", "no-user-rc"], "sshk
eys": [""]}, "msg": "file (/etc/ssh/authorized_keys/checkmk) is absent, cannot continue", "path": "/etc/ssh/authorized_keys/checkmk", "state": "absent"}

Reason: The public key given to the debops.authorized_keys role is empty. If you haven't defined checkmk_agent__user_key in the Ansible inventory, it will try to lookup the information required in the Ansible local facts of the Check_MK server. If this fails, there won't be a key which results in this error. One bug related to this was already fixed with #25.

Work-around: This error is known to be happen also if you simply try to install an agent but don't have the host running the master site included in the playbook run. In this case hostvars[checkmk_agent__server].ansible_local.checkmk_server will be undefined. To work around the issue, make sure that you manually define all the variables which are looked up via the Check_MK server local facts. E.g. checkmk_agent__site, checkmk_agent__user_key, checkmk_agent__autojoin_url, checkmk_agent__autojoin_secret

I'm currently elaborating possible ways how to solve this issue. Please be patent. If you have an idea, let me know...

@ganto ganto added the bug label Jan 26, 2017
@ganto ganto changed the title Agent setup fails in "debops.authorized_keys : Enforce state of authorized_keys user files]" Agent setup fails in "debops.authorized_keys : Enforce state of authorized_keys user files" Jan 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant