2020-09-09 16:10:42 +02:00
|
|
|
---
|
|
|
|
- name: Verify
|
|
|
|
hosts: all
|
|
|
|
tasks:
|
2021-02-05 16:24:23 +01:00
|
|
|
- name: Check if NGINX Plus is installed
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.package:
|
2020-09-20 12:15:28 +02:00
|
|
|
name: nginx-plus
|
2021-02-05 16:24:23 +01:00
|
|
|
state: present
|
2021-06-02 17:47:44 +02:00
|
|
|
check_mode: true
|
2020-09-20 12:15:28 +02:00
|
|
|
register: install
|
|
|
|
failed_when: (install is changed) or (install is failed)
|
|
|
|
|
2021-02-05 16:24:23 +01:00
|
|
|
- name: Check if NGINX Plus service is running
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.service:
|
2020-09-09 16:10:42 +02:00
|
|
|
name: nginx
|
|
|
|
state: started
|
2021-06-02 17:47:44 +02:00
|
|
|
enabled: true
|
|
|
|
check_mode: true
|
2020-09-09 16:10:42 +02:00
|
|
|
register: service
|
|
|
|
failed_when: (service is changed) or (service is failed)
|
|
|
|
|
2021-02-05 16:24:23 +01:00
|
|
|
- name: Verify NGINX Plus is up and running
|
2022-03-22 18:27:11 +01:00
|
|
|
ansible.builtin.uri:
|
2020-09-09 16:10:42 +02:00
|
|
|
url: http://localhost
|
|
|
|
status_code: 200
|