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
dddd714b
Commit
dddd714b
authored
2 years ago
by
Alexander Käb
Browse files
Options
Downloads
Patches
Plain Diff
Generate SANs from jinja template
parent
cea3b9e9
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+19
-0
19 additions, 0 deletions
README.md
defaults/main.yml
+9
-1
9 additions, 1 deletion
defaults/main.yml
tasks/node-certs.yml
+1
-5
1 addition, 5 deletions
tasks/node-certs.yml
templates/node-cert-sans.j2
+24
-0
24 additions, 0 deletions
templates/node-cert-sans.j2
with
53 additions
and
6 deletions
README.md
+
19
−
0
View file @
dddd714b
...
...
@@ -64,4 +64,23 @@ cert_valid_days: 1095
# The passphrase used for the CA file
sidecar_ca_passphrase
:
```
### SAN config
To configure the SANs that will be added to the node certificates the following options
are available. The FQDN and short name of the node will always be added. The settings
below only apply to
`IP`
SAN entries.
```
yaml
# Control the IP family to use
use_ipv4
:
true
use_ipv6
:
true
# If set to true, the IP of the default route interface will be used
use_default
:
true
# If set to true, the IP of the provided interface name will be used
use_interface_ip
:
false
iface_name
:
"
"
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
defaults/main.yml
+
9
−
1
View file @
dddd714b
...
...
@@ -15,4 +15,12 @@ generate_node_certs: true
tmp_cert_dir
:
"
/tmp/graylog-sidecar-certs"
# local directory
gl_sidecar_ca_path
:
"
/etc/graylog/sidecar"
sidecar_cert_dir
:
"
/etc/graylog/sidecar"
cert_valid_days
:
1095
\ No newline at end of file
cert_valid_days
:
1095
# Cert SAN settings
node_cert_sans
:
"
{{
lookup('template',
'node-cert-sans.j2')
}}"
use_ipv4
:
true
use_ipv6
:
true
use_default
:
true
use_interface_ip
:
false
iface_name
:
"
"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tasks/node-certs.yml
+
1
−
5
View file @
dddd714b
...
...
@@ -39,11 +39,7 @@
community.crypto.openssl_csr_pipe
:
privatekey_path
:
"
{{
tmp_cert_dir
}}/sidecar-{{
inventory_hostname
}}.key"
common_name
:
"
{{
ansible_fqdn
}}"
# CN
subject_alt_name
:
-
"
DNS:{{
inventory_hostname
}}"
-
"
DNS:{{
ansible_fqdn
}}"
-
"
IP:{{
ansible_default_ipv6.address
}}"
# - "IP:{{ ansible_default_ipv4.address }}"
subject_alt_name
:
"
{{
node_cert_sans
}}"
register
:
"
node_csr"
-
name
:
Node Certificates | Generate Certificates
...
...
This diff is collapsed.
Click to expand it.
templates/node-cert-sans.j2
0 → 100644
+
24
−
0
View file @
dddd714b
{%- macro ansible_iface(name) -%}
ansible_{{name}}
{%- endmacro -%}
- "DNS:{{ inventory_hostname }}"
- "DNS:{{ ansible_fqdn }}"
{% if use_default == true -%}
{% if use_ipv4 == true and ansible_default_ipv4.address is defined -%}
- "IP:{{ ansible_default_ipv4.address }}"
{% endif -%}
{% if use_ipv6 == true and ansible_default_ipv6.address is defined -%}
- "IP:{{ ansible_default_ipv6.address }}"
{% endif -%}
{% endif -%}
{% if use_interface_ip == true -%}
{% if ansible_facts[ansible_iface(iface_name)] is defined -%}
{% if use_ipv4 == true and ansible_facts[ansible_iface(iface_name)].ipv4.address is defined -%}
- "IP:{{ ansible_facts[ansible_iface(iface_name)].ipv6.address }}"
{% endif -%}
{% 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 -%}
\ 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