Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arnaud Véron
slapos.package
Commits
716b7749
Commit
716b7749
authored
Dec 20, 2022
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playbook/ridge: fix waitfor fluentbit and display more infos to log
parent
02c4eb6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
5 deletions
+34
-5
playbook/roles/ridge/tasks/main.yml
playbook/roles/ridge/tasks/main.yml
+34
-5
No files found.
playbook/roles/ridge/tasks/main.yml
View file @
716b7749
...
...
@@ -11,12 +11,20 @@
-
name
:
Create configuration from template
shell
:
"
sed
'{{conf_regex}}'
{{conf}}.in
>
{{conf}}"
-
name
:
save fluentbit conf
shell
:
cat {{conf}}
register
:
fluentbit_conf_content
-
name
:
print fluentbit conf to a console
debug
:
msg
:
"
{{
fluentbit_conf_content.stdout
}}"
-
name
:
Launch fluent-bit
shell
:
"
{{flb}}
-e
{{plugin}}
-c
{{conf}}
&"
# TODO: store fluent-bit's PID to wait for it at the end
shell
:
"
{{flb}}
-e
{{plugin}}
-c
{{conf}}
2>fluentbit.log&"
-
name
:
Pre-scan
shell
:
'
sleep
1
;
echo
"{\"beginning_date\":
\"{{
ansible_date_time.iso8601
}}\"}"
>>
{{log}}'
shell
:
'
sleep
60
;
echo
"{\"beginning_date\":
\"{{
ansible_date_time.iso8601
}}\"}"
>>
{{log}}'
-
name
:
Scan /sbin
shell
:
"
{{mca}}
/sbin
{{log}}"
...
...
@@ -27,9 +35,30 @@
-
name
:
Post-scan
shell
:
'
echo
"{\"end_date\":
\"{{
ansible_date_time.iso8601
}}\",
\"end_marker\":
\"fluentbit_end\"}"
>>
{{log}}'
-
name
:
display fluentbit log
shell
:
cat fluentbit.log
register
:
fluentbit_log_content
-
name
:
Print the fluentbit log content to a console
debug
:
msg
:
"
{{
fluentbit_log_content.stdout
}}"
-
name
:
get fluent-bit pid
shell
:
'
pidof
fluent-bit'
register
:
fluentbit_pid
-
name
:
Print the fluentbit log content to a console
debug
:
msg
:
"
{{
fluentbit_pid.stdout
}}"
-
name
:
Wait fluent-bit
shell
:
'
waitpid
$(pidof
fluent-bit)
||
true'
# pid not found: fluent-bit ended correctly before "pidof" is run
ansible.builtin.wait_for
:
timeout
:
600
path
:
/proc/{{fluentbit_pid.stdout}}/status
state
:
absent
when
:
fluentbit_pid != ""
-
name
:
"
Build
successful,
connect
to:"
shell
:
"
true"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment