-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: host_vars and group_vars custom ssh_from
- Loading branch information
1 parent
898b747
commit 6888f20
Showing
3 changed files
with
23 additions
and
7 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
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,10 +1,11 @@ | ||
{%- for ssh_key in item.ssh_public_keys -%} | ||
{%- set from_options_global = user_management_default_ssh_from -%} | ||
{%- set from_options_custom_host = host_vars_ssh_from | default([]) -%} | ||
{%- set from_options_group_vars = user_management_group_ssh_from | default([]) -%} | ||
{%- set from_options_host_vars = user_management_host_ssh_from | default([]) -%} | ||
{%- set from_options_custom_item = item.custom_ssh_from | default([]) -%} | ||
{%- set from_options_custom = from_options_custom_host + from_options_custom_item | default([]) -%} | ||
{%- set from_options_custom = from_options_group_vars + from_options_host_vars+ from_options_custom_item | default([]) -%} | ||
{%- set from_options = from_options_global + from_options_custom | default([]) -%} | ||
{%- if ssh_key is defined -%} | ||
from="{% if from_options %}{{ from_options | join(',') }}{% else %}*{% endif %}" {{ ssh_key }} | ||
{% if from_options %}from="{{ from_options | join(',') }}" {% endif %}{{ ssh_key }} | ||
{% endif %} | ||
{% endfor %} |