-
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 (#608)
* add verify-task to check if mysql is running and enabled Signed-off-by: Sebastian Gumprich <[email protected]> * Update molecule/mysql_hardening/verify_tasks/service.yml Co-authored-by: schurzi <[email protected]> Signed-off-by: Sebastian Gumprich <[email protected]> Co-authored-by: schurzi <[email protected]>
- Loading branch information
Showing
3 changed files
with
20 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,16 @@ | ||
--- | ||
- 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: | ||
|
||
- 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