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

Set theo_agent_sshd_authorized_keys_command var in a specific task. Closes #44 #42

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ theo_agent_cache_dir: /var/cache/theo-agent
theo_agent_verify_signature: false
theo_agent_public_key: ""
theo_agent_public_key_path: "{{ theo_agent_config_dir }}/public.pem"
theo_agent_sshd_authorized_keys_command: "{{ theo_agent_path }}"
theo_agent_hostname_prefix: ""
theo_agent_hostname_suffix: ""
8 changes: 8 additions & 0 deletions molecule/default/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@

roles:
- role: ansible-theo-agent

- name: Converge again
hosts: all
vars:
- theo_url: https://theo.example.com
- theo_client_token: zdOPNza4jjtceH5F2rU0iOkIJ2xlV4hGUauKT4cNe8HAp+AMnzYEzSc0EIBGM+MJuqL7gLd6bwIP
roles:
- role: ansible-theo-agent
4 changes: 4 additions & 0 deletions tasks/sshd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
sshd_current_version is version('6.4', '>=')
msg: With OpenSSH < 6.4 theo_agent_config_path must be /etc/theo-agent/config.yml

- name: Set AuthorizedKeysCommand
set_fact:
theo_agent_sshd_authorized_keys_command: "{{ theo_agent_path }}"

- name: Set AuthorizedKeysCommand config snippet 1
set_fact:
theo_agent_sshd_authorized_keys_command: "{{ theo_agent_sshd_authorized_keys_command }} -config-file {{ theo_agent_config_path }}"
Expand Down