2020-07-20 13:37:36 +02:00
|
|
|
---
|
|
|
|
- name: Verify
|
|
|
|
hosts: all
|
|
|
|
tasks:
|
|
|
|
- name: Check if NGINX is installed
|
|
|
|
package:
|
|
|
|
name: nginx
|
|
|
|
check_mode: yes
|
|
|
|
register: install
|
|
|
|
failed_when: (install is changed) or (install is failed)
|
|
|
|
|
|
|
|
- name: Check if NGINX service is running
|
|
|
|
service:
|
|
|
|
name: nginx
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
check_mode: yes
|
|
|
|
register: service
|
|
|
|
failed_when: (service is changed) or (service is failed)
|
|
|
|
|
|
|
|
- name: Check default.conf does not exist
|
|
|
|
stat:
|
|
|
|
path: /etc/nginx/conf.d/default.conf
|
2020-08-28 10:30:23 +02:00
|
|
|
check_mode: yes
|
2020-07-20 13:37:36 +02:00
|
|
|
register: stat_result
|
|
|
|
failed_when: stat_result.stat.exists
|