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
c56e1a98
Commit
c56e1a98
authored
2 years ago
by
Alexander Käb
Browse files
Options
Downloads
Patches
Plain Diff
fix: Fix conditionals for task file includes
parent
7c57d798
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
defaults/main.yml
+1
-0
1 addition, 0 deletions
defaults/main.yml
tasks/main.yml
+47
-21
47 additions, 21 deletions
tasks/main.yml
tasks/sidecar.yml
+1
-0
1 addition, 0 deletions
tasks/sidecar.yml
with
49 additions
and
21 deletions
defaults/main.yml
+
1
−
0
View file @
c56e1a98
...
@@ -16,6 +16,7 @@ generate_node_certs: true
...
@@ -16,6 +16,7 @@ generate_node_certs: true
gl_sidecar_ca_path
:
"
/etc/graylog/sidecar"
gl_sidecar_ca_path
:
"
/etc/graylog/sidecar"
sidecar_cert_dir
:
"
/etc/graylog/sidecar"
sidecar_cert_dir
:
"
/etc/graylog/sidecar"
cert_valid_days
:
1095
cert_valid_days
:
1095
gl_node_ca_path
:
{{
gl_sidecar_ca_path
}}
# Cert SAN settings
# Cert SAN settings
node_cert_sans
:
"
{{
lookup('template',
'node-cert-sans.j2')
|
replace('
\n
',
'')
|
split(',')
|
map('trim')
|
list
}}"
node_cert_sans
:
"
{{
lookup('template',
'node-cert-sans.j2')
|
replace('
\n
',
'')
|
split(',')
|
map('trim')
|
list
}}"
...
...
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
47
−
21
View file @
c56e1a98
...
@@ -12,19 +12,19 @@
...
@@ -12,19 +12,19 @@
ansible.builtin.fail
:
ansible.builtin.fail
:
msg
:
"
Please
add
a
host
group
'sidecar-ca'
with
the
host(s)
storing
the
CA
file
first"
msg
:
"
Please
add
a
host
group
'sidecar-ca'
with
the
host(s)
storing
the
CA
file
first"
run_once
:
true
run_once
:
true
when
:
"
not
(
groups[
'sidecar-ca'
]
i
s
defined
)"
when
:
"
not
('sidecar-ca'
i
n
groups
)"
-
name
:
Fail if 'graylog-nodes' host group is missing
# noqa: run_once[task]
-
name
:
Fail if 'graylog-nodes' host group is missing
# noqa: run_once[task]
ansible.builtin.fail
:
ansible.builtin.fail
:
msg
:
"
Please
add
a
host
group
'graylog-nodes'
with
the
host(s)
storing
the
log
node
CA
file
first"
msg
:
"
Please
add
a
host
group
'graylog-nodes'
with
the
host(s)
storing
the
log
node
CA
file
first"
run_once
:
true
run_once
:
true
when
:
"
not
(
groups[
'graylog-nodes'
]
i
s
defined
)"
when
:
"
not
('graylog-nodes'
i
n
groups
)"
-
name
:
Fail if 'ca-store' host group is missing while using opetion 'use_central_ca_host'
# noqa: run_once[task]
-
name
:
Fail if 'ca-store' host group is missing while using opetion 'use_central_ca_host'
# noqa: run_once[task]
ansible.builtin.fail
:
ansible.builtin.fail
:
msg
:
"
Please
add
a
host
group
'sidecar-ca'
with
the
host(s)
storing
the
CA
file
first"
msg
:
"
Please
add
a
host
group
'sidecar-ca'
with
the
host(s)
storing
the
CA
file
first"
run_once
:
true
run_once
:
true
when
:
"
(not
(
groups[
'ca-store'
]
i
s
defined
))
and
use_central_ca_host"
when
:
"
(not
('ca-store'
i
n
groups
))
and
use_central_ca_host"
-
name
:
Include tasks when not using single ca-host
-
name
:
Include tasks when not using single ca-host
when
:
not use_central_ca_host
when
:
not use_central_ca_host
...
@@ -45,24 +45,34 @@
...
@@ -45,24 +45,34 @@
-
name
:
Include tasks when using single ca-host
-
name
:
Include tasks when using single ca-host
when
:
use_central_ca_host
when
:
use_central_ca_host
block
:
block
:
-
name
:
Include sidecar tasks (when using a single ca store)
-
name
:
Include sidecar tasks (when using a single ca store and gl-groups defined)
ansible.builtin.include_tasks
:
sidecar.yml
when
:
(('sidecar-ca' in groups) and ('graylog-nodes' in groups))
when
:
>
block
:
((groups['sidecar-ca'] is defined) and (groups['graylog-nodes'] is defined) | ternary(
-
name
:
Include sidecar tasks (when using a single ca store and gl-groups defined)
(inventory_hostname not in groups['sidecar-ca']) and
ansible.builtin.include_tasks
:
sidecar.yml
(inventory_hostname not in groups['graylog-nodes'])
when
:
>
, true)) and
(inventory_hostname not in groups['sidecar-ca']) and
(inventory_hostname not in groups['ca-store'])
(inventory_hostname not in groups['graylog-nodes']) and
(inventory_hostname not in groups['ca-store'])
-
name
:
Include filebeat tasks
-
name
:
Include filebeat tasks (when using a single ca store and gl-groups defined)
ansible.builtin.include_tasks
:
filebeat.yml
ansible.builtin.include_tasks
:
filebeat.yml
when
:
>
when
:
>
install_filebeat and
install_filebeat and
((groups['sidecar-ca'] is defined) and (groups['graylog-nodes'] is defined) | ternary(
(inventory_hostname not in groups['sidecar-ca']) and
(inventory_hostname not in groups['sidecar-ca']) and
(inventory_hostname not in groups['graylog-nodes']) and
(inventory_hostname not in groups['graylog-nodes'])
(inventory_hostname not in groups['ca-store'])
, true)) and
(inventory_hostname not in groups['ca-store'])
-
name
:
Include sidecar tasks (when using a single ca store without gl-groups defined)
when
:
not (('sidecar-ca' in groups) and ('graylog-nodes' in groups))
block
:
-
name
:
Include sidecar tasks (when using a single ca store without gl-groups defined)
ansible.builtin.include_tasks
:
sidecar.yml
when
:
(inventory_hostname not in groups['ca-store'])
-
name
:
Include filebeat tasks (when using a single ca store without gl-groups defined)
ansible.builtin.include_tasks
:
filebeat.yml
when
:
(inventory_hostname not in groups['ca-store'])
-
name
:
Switch back to default policy
-
name
:
Switch back to default policy
ansible.builtin.command
:
ansible.builtin.command
:
...
@@ -71,5 +81,21 @@
...
@@ -71,5 +81,21 @@
become
:
true
become
:
true
-
name
:
Generate Node certificates
-
name
:
Generate Node certificates
ansible.builtin.import_tasks
:
node-certs.yml
when
:
generate_node_certs
when
:
generate_node_certs
block
:
-
name
:
Include cert tasks (with gl-groups defined)
when
:
(('sidecar-ca' in groups) and ('graylog-nodes' in groups))
block
:
-
name
:
Include Node Cert tasks (with gl-groups defined)
ansible.builtin.include_tasks
:
node-certs.yml
when
:
>
(inventory_hostname not in groups['sidecar-ca']) and
(inventory_hostname not in groups['graylog-nodes']) and
(inventory_hostname not in groups['ca-store'])
-
name
:
Include cert tasks (without gl-groups defined)
when
:
not (('sidecar-ca' in groups) and ('graylog-nodes' in groups))
block
:
-
name
:
Include Node Cert tasks (without gl-groups defined)
ansible.builtin.include_tasks
:
node-certs.yml
when
:
(inventory_hostname not in groups['ca-store'])
This diff is collapsed.
Click to expand it.
tasks/sidecar.yml
+
1
−
0
View file @
c56e1a98
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
ansible.builtin.yum
:
ansible.builtin.yum
:
name
:
/tmp/graylog-sidecar.rpm
name
:
/tmp/graylog-sidecar.rpm
state
:
present
state
:
present
disable_gpg_check
:
true
# Github rpm is not signed, may replace true with actual check if signed or not
-
name
:
Run install command
-
name
:
Run install command
ansible.builtin.command
:
ansible.builtin.command
:
...
...
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