2020-07-20 13:37:36 +02:00
|
|
|
---
|
|
|
|
- name: Verify
|
|
|
|
hosts: all
|
|
|
|
tasks:
|
|
|
|
- name: Check if NGINX is installed
|
|
|
|
package:
|
|
|
|
name: nginx
|
2021-02-05 16:24:23 +01:00
|
|
|
state: present
|
2021-06-02 17:47:44 +02:00
|
|
|
check_mode: true
|
2020-07-20 13:37:36 +02:00
|
|
|
register: install
|
|
|
|
failed_when: (install is changed) or (install is failed)
|
|
|
|
|
|
|
|
- name: Check if NGINX service is running
|
|
|
|
service:
|
|
|
|
name: nginx
|
|
|
|
state: started
|
2021-06-02 17:47:44 +02:00
|
|
|
enabled: true
|
|
|
|
check_mode: true
|
2020-07-20 13:37:36 +02:00
|
|
|
register: service
|
|
|
|
failed_when: (service is changed) or (service is failed)
|
|
|
|
|
|
|
|
- name: Verify NGINX is up and running
|
|
|
|
uri:
|
|
|
|
url: http://localhost
|
|
|
|
status_code: 200
|