-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add verify-task to check if mysql is running and enabled
Signed-off-by: Sebastian Gumprich <[email protected]>
- Loading branch information
Sebastian Gumprich
committed
Dec 6, 2022
1 parent
b0454fa
commit 22b12a7
Showing
3 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
- name: Load variables from role to use the "mysql_daemon" variable | ||
ansible.builtin.include_role: | ||
name: devsec.hardening.mysql_hardening | ||
apply: | ||
tags: | ||
- never | ||
|
||
- name: Populate service facts | ||
ansible.builtin.service_facts: | ||
|
||
- debug: | ||
var: ansible_facts.services | ||
|
||
- name: Check if MySQL is running and enabled | ||
assert: | ||
that: | ||
- "ansible_facts.services[mysql_daemon + '.service'].state == 'running'" | ||
- "ansible_facts.services[mysql_daemon + '.service'].status == 'enabled'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters