You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to fill the template with my node's configuration. I've stumbled upon the gitlab_rails['ldap_servers'] configuration which confuses me. I use hiera to fill in the template, which is easy for simple 'variables' but the ldap_servers key has multiple lines which may subsequently be templated, too.
The relevant part of my template so far, which I wish to exchange for your great template, looks as follows:
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' # remember to close this block with 'EOS' below
main: # 'main' is the GitLab 'provider ID' of this LDAP server
label: <%= @gitlab_rails['ldap_servers']['label'] %>
host: <%= @gitlab_rails['ldap_servers']['host'] %>
port: <%= @gitlab_rails['ldap_servers']['port'] %>
uid: <%= @gitlab_rails['ldap_servers']['uid'] %>
method: <%= @gitlab_rails['ldap_servers']['method'] %> # "tls" or "ssl" or "plain"
bind_dn: <%= @gitlab_rails['ldap_servers']['bind_dn'] %>
password: <%= @gitlab_rails['ldap_servers']['password'] %>
active_directory: <%= @gitlab_rails['ldap_servers']['active_directory'] %>
allow_username_or_email_login: <%= @gitlab_rails['ldap_servers']['allow_username_or_email_login'] %>
block_auto_created_users: false
base: <%= @gitlab_rails['ldap_servers']['base'] %>
<% if gitlab_rails['ldap_servers'].has_key? 'user_filter' -%>
user_filter: <%= @gitlab_rails['ldap_servers']['user_filter'] %>
<% else -%>
user_filter: ''
<% end -%>
username: <%= @gitlab_rails['ldap_servers']['username'] %>
email: <%= @gitlab_rails['ldap_servers']['email'] %>
# If no full name could be found at the attribute specified for `name`,
# the full name is determined using the attributes specified for
# `first_name` and `last_name`.
name: <%= @gitlab_rails['ldap_servers']['name'] %>
first_name: 'givenName'
last_name: 'sn'
## EE only
<% if gitlab_rails['ldap_servers'].has_key? 'group_base' -%>
group_base: <%= @gitlab_rails['ldap_servers']['group_base'] %>
<% else -%>
group_base: ''
<% end -%>
admin_group: ''
<% if gitlab_rails['ldap_servers'].has_key? 'sync_ssh_keys' -%>
sync_ssh_keys: <%= @gitlab_rails['ldap_servers']['sync_ssh_keys'] %>
<% end -%>
EOS
How can I accomplish the same with hiera (edit: using your template...)? I am willing to set each ldap_servers-part as its own block - if there is no nicer way possible -, too, but I am not familiar enough to understand how to do it with hiera. Could you please provide me with a simple example? It does not necessarily need to set all of the above settings, just for me to get me started.
EDIT2: This question is obviously quite general and not only restricted to ldap_servers. also gitlab_rails['omniauth_providers'] is a similar case, where I was setting each parameter independently.
On second thought, I feel like it would be nice to add those (special) multi-line-settings explicitly in the template, such that subsequent parameters may be set more consistently defined in a hiera file.
The text was updated successfully, but these errors were encountered:
I'm trying to fill the template with my node's configuration. I've stumbled upon the
gitlab_rails['ldap_servers']
configuration which confuses me. I use hiera to fill in the template, which is easy for simple 'variables' but the ldap_servers key has multiple lines which may subsequently be templated, too.The relevant part of my template so far, which I wish to exchange for your great template, looks as follows:
How can I accomplish the same with hiera (edit: using your template...)? I am willing to set each ldap_servers-part as its own block - if there is no nicer way possible -, too, but I am not familiar enough to understand how to do it with hiera. Could you please provide me with a simple example? It does not necessarily need to set all of the above settings, just for me to get me started.
EDIT2: This question is obviously quite general and not only restricted to ldap_servers. also
gitlab_rails['omniauth_providers']
is a similar case, where I was setting each parameter independently.On second thought, I feel like it would be nice to add those (special) multi-line-settings explicitly in the template, such that subsequent parameters may be set more consistently defined in a hiera file.
The text was updated successfully, but these errors were encountered: