Linting, fixing, requirements.txt
This commit is contained in:
@@ -4,34 +4,35 @@
|
||||
hosts: all
|
||||
|
||||
tasks:
|
||||
- name: check if vsftpd is installed
|
||||
- name: Check if nginx is installed
|
||||
ansible.builtin.dnf:
|
||||
name: nginx
|
||||
state: present
|
||||
check_mode: yes
|
||||
register: pkg
|
||||
check_mode: true
|
||||
register: pkg
|
||||
|
||||
- name: fail if package was not installed
|
||||
- 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."
|
||||
fail_msg: Package nginx was not installed!
|
||||
success_msg: Package nginx was installed.
|
||||
|
||||
- name: check service is stopped
|
||||
- name: Check service is started
|
||||
ansible.builtin.systemd:
|
||||
name: nginx
|
||||
enabled: true
|
||||
state: started
|
||||
check_mode: yes
|
||||
register: svc
|
||||
check_mode: true
|
||||
register: svc
|
||||
|
||||
- name: fail if service was activated
|
||||
assert:
|
||||
- name: Fail if service was not activated
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- svc.changed is false
|
||||
success_msg: "Service vsftpd was disabled."
|
||||
fail_msg: "Service vsftpd was activated!"
|
||||
success_msg: Service nginx was enabled.
|
||||
fail_msg: Service nginx was not enabled!
|
||||
|
||||
- name: test result
|
||||
debug: msg="FTP daemon was installed and disabled. Test OK"
|
||||
- name: Test result
|
||||
ansible.builtin.debug:
|
||||
msg: nginx daemon was installed and enabled. Test OK
|
||||
|
||||
Reference in New Issue
Block a user