38 lines
860 B
YAML
38 lines
860 B
YAML
---
|
|
|
|
- name: Verfiy nginx
|
|
hosts: all
|
|
|
|
tasks:
|
|
- name: check if vsftpd is installed
|
|
ansible.builtin.dnf:
|
|
name: nginx
|
|
state: present
|
|
check_mode: yes
|
|
register: pkg
|
|
|
|
- name: fail if package was not installed
|
|
ansible.builtin.assert:
|
|
that:
|
|
- pkg.changed is false
|
|
fail_msg: "Package vsftpd was not installed!"
|
|
success_msg: "Package vsftpd was installed."
|
|
|
|
- name: check service is stopped
|
|
ansible.builtin.systemd:
|
|
name: nginx
|
|
enabled: true
|
|
state: started
|
|
check_mode: yes
|
|
register: svc
|
|
|
|
- name: fail if service was activated
|
|
assert:
|
|
that:
|
|
- svc.changed is false
|
|
success_msg: "Service vsftpd was disabled."
|
|
fail_msg: "Service vsftpd was activated!"
|
|
|
|
- name: test result
|
|
debug: msg="FTP daemon was installed and disabled. Test OK"
|