Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ansible-graylog-sidecar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hdacloud
ansible-graylog-sidecar
Commits
5879fede
Commit
5879fede
authored
2 years ago
by
Alexander Käb
Browse files
Options
Downloads
Patches
Plain Diff
fix(certs): Fix node cert SAN template structure and variable assignment
parent
dddd714b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
defaults/main.yml
+1
-1
1 addition, 1 deletion
defaults/main.yml
templates/node-cert-sans.j2
+19
-21
19 additions, 21 deletions
templates/node-cert-sans.j2
with
20 additions
and
22 deletions
defaults/main.yml
+
1
−
1
View file @
5879fede
...
@@ -18,7 +18,7 @@ sidecar_cert_dir: "/etc/graylog/sidecar"
...
@@ -18,7 +18,7 @@ sidecar_cert_dir: "/etc/graylog/sidecar"
cert_valid_days
:
1095
cert_valid_days
:
1095
# Cert SAN settings
# Cert SAN settings
node_cert_sans
:
"
{{
lookup('template',
'node-cert-sans.j2')
}}"
node_cert_sans
:
"
{{
lookup('template',
'node-cert-sans.j2')
|
replace('
\n
',
'')
|
split(',')
|
map('trim')
|
list
}}"
use_ipv4
:
true
use_ipv4
:
true
use_ipv6
:
true
use_ipv6
:
true
use_default
:
true
use_default
:
true
...
...
This diff is collapsed.
Click to expand it.
templates/node-cert-sans.j2
+
19
−
21
View file @
5879fede
{%- macro ansible_iface(name) -%}
DNS:{{ inventory_hostname }},
ansible_{{name}}
DNS:{{ ansible_fqdn }},
{%- endmacro -%}
{%- if use_default == true -%}
{%- if use_ipv4 == true and ansible_default_ipv4.address is defined -%}
- "DNS:{{ inventory_hostname }}"
IP:{{ ansible_default_ipv4.address }},
- "DNS:{{ ansible_fqdn }}"
{%- endif -%}
{% if use_default == true -%}
{%- if use_ipv6 == true and ansible_default_ipv6.address is defined -%}
{% if use_ipv4 == true and ansible_default_ipv4.address is defined -%}
IP:{{ ansible_default_ipv6.address }},
- "IP:{{ ansible_default_ipv4.address }}"
{%- endif -%}
{% endif -%}
{%- endif -%}
{% if use_ipv6 == true and ansible_default_ipv6.address is defined -%}
{%- if use_interface_ip == true -%}
- "IP:{{ ansible_default_ipv6.address }}"
{%- if ansible_facts[iface_name] is defined -%}
{% endif -%}
{%- if use_ipv4 == true and ansible_facts[iface_name].ipv4.address is defined -%}
{% endif -%}
IP:{{ ansible_facts[iface_name].ipv6.address }},
{% if use_interface_ip == true -%}
{%- endif -%}
{% if ansible_facts[ansible_iface(iface_name)] is defined -%}
{%- if use_ipv6 == true and (ansible_facts[iface_name].ipv6 | selectattr("scope", "equalto", "global") | length > 0) -%}
{% if use_ipv4 == true and ansible_facts[ansible_iface(iface_name)].ipv4.address is defined -%}
{%- for ip in (ansible_facts[iface_name].ipv6 | selectattr("scope", "equalto", "global"))%}
- "IP:{{ ansible_facts[ansible_iface(iface_name)].ipv6.address }}"
IP:{{ ip.address }}{% if not loop.last %},{% endif %}
{% endif -%}
{%- endfor -%}
{% if use_ipv6 == true and ansible_facts[ansible_iface(iface_name)].ipv6.address is defined -%}
- "IP:{{ ansible_facts[ansible_iface(iface_name)].ipv6.address }}"
{%- endif -%}
{%- endif -%}
{%- endif-%}
{%- endif-%}
{%- endif -%}
{%- endif -%}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment