* 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]>
17 lines
477 B
YAML
17 lines
477 B
YAML
---
|
|
- 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'"
|