fix ansible-lint errors
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
---
|
||||
default_curl_cmd: "/usr/bin/curl"
|
||||
default_curl_args: "-fsS -m 10"
|
||||
default_schedule: "minutely"
|
||||
curl_scheduled_curl_cmd: "/usr/bin/curl"
|
||||
curl_scheduled_curl_args: "-fsS -m 10"
|
||||
curl_scheduled_schedule: "minutely"
|
||||
|
||||
@@ -10,8 +10,8 @@ galaxy_info:
|
||||
|
||||
platforms:
|
||||
- name: "Ubuntu"
|
||||
versions: [ "focal", "jammy", "noble" ]
|
||||
versions: ["focal", "jammy", "noble"]
|
||||
|
||||
galaxy_tags: [ ]
|
||||
galaxy_tags: []
|
||||
|
||||
dependencies: []
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
executable: /bin/bash
|
||||
|
||||
roles:
|
||||
- role: genlab.curl_scheduled
|
||||
- role: genlab.common.curl_scheduled
|
||||
services:
|
||||
- label: "localhost-test-zero"
|
||||
url: "http://127.0.0.1:8080"
|
||||
|
||||
@@ -7,75 +7,75 @@
|
||||
# Verify the systemd timers
|
||||
|
||||
- name: "Check the timer status - localhost-test-zero"
|
||||
register: timer_zero
|
||||
register: curl_scheduled_timer_zero
|
||||
ansible.builtin.systemd:
|
||||
name: "curl-localhost-test-zero.timer"
|
||||
|
||||
- name: "Assert that the localhost-test-zero timer is running"
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- timer_zero.status.ActiveState == "active"
|
||||
- curl_scheduled_timer_zero.status.ActiveState == "active"
|
||||
success_msg: "Timer is running"
|
||||
fail_msg: "Unexpected timer state: '{{ timer_zero.status.ActiveState }}'"
|
||||
fail_msg: "Unexpected timer state: '{{ curl_scheduled_timer_zero.status.ActiveState }}'"
|
||||
|
||||
- name: "Check the timer status - localhost-test-one"
|
||||
register: timer_one
|
||||
register: curl_scheduled_timer_one
|
||||
ansible.builtin.systemd:
|
||||
name: "curl-localhost-test-one.timer"
|
||||
|
||||
- name: "Assert that the localhost-test-one timer is running"
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- timer_one.status.ActiveState == "active"
|
||||
- curl_scheduled_timer_one.status.ActiveState == "active"
|
||||
success_msg: "Timer is running"
|
||||
fail_msg: "Unexpected timer state: '{{ timer_one.status.ActiveState }}'"
|
||||
fail_msg: "Unexpected timer state: '{{ curl_scheduled_timer_one.status.ActiveState }}'"
|
||||
|
||||
- name: "Check the timer status - localhost-test-chained-curl"
|
||||
register: timer_chained_curl
|
||||
register: curl_scheduled_timer_chained_curl
|
||||
ansible.builtin.systemd:
|
||||
name: "curl-localhost-test-chained-curl.timer"
|
||||
|
||||
- name: "Assert that the localhost-test-chained-curl timer is running"
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- timer_chained_curl.status.ActiveState == "active"
|
||||
- curl_scheduled_timer_chained_curl.status.ActiveState == "active"
|
||||
success_msg: "Timer is running"
|
||||
fail_msg: "Unexpected timer state: '{{ timer_chained_curl.status.ActiveState }}'"
|
||||
fail_msg: "Unexpected timer state: '{{ curl_scheduled_timer_chained_curl.status.ActiveState }}'"
|
||||
|
||||
## Verify the systemd services
|
||||
|
||||
- name: "Check the service status - zero"
|
||||
register: service_zero
|
||||
register: curl_scheduled_service_zero
|
||||
ansible.builtin.systemd:
|
||||
name: "curl-localhost-test-zero.service"
|
||||
|
||||
- name: "Assert that the localhost-test-zero service exited with a 0/SUCCESS status"
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- 'service_zero.status.ExecMainStatus == "0"'
|
||||
- 'curl_scheduled_service_zero.status.ExecMainStatus == "0"'
|
||||
success_msg: "Service has exited with a 0/SUCCESS status"
|
||||
fail_msg: "Unexpected service status code: '{{ service_zero.status.ExecMainStatus }}'"
|
||||
fail_msg: "Unexpected service status code: '{{ curl_scheduled_service_zero.status.ExecMainStatus }}'"
|
||||
|
||||
- name: "Check the service status - one"
|
||||
register: service_one
|
||||
register: curl_scheduled_service_one
|
||||
ansible.builtin.systemd:
|
||||
name: "curl-localhost-test-one.service"
|
||||
|
||||
- name: "Assert that the localhost-test-one service exited with a 0/SUCCESS status"
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- 'service_one.status.ExecMainStatus == "0"'
|
||||
- 'curl_scheduled_service_one.status.ExecMainStatus == "0"'
|
||||
success_msg: "Service has exited with a 0/SUCCESS status"
|
||||
fail_msg: "Unexpected service status code: '{{ service_one.status.ExecMainStatus }}'"
|
||||
fail_msg: "Unexpected service status code: '{{ curl_scheduled_service_one.status.ExecMainStatus }}'"
|
||||
|
||||
- name: "Check the service status - localhost-test-chained-curl"
|
||||
register: service_chained_curl
|
||||
register: curl_scheduled_service_chained_curl
|
||||
ansible.builtin.systemd:
|
||||
name: "curl-localhost-test-chained-curl.service"
|
||||
|
||||
- name: "Assert that the localhost-test-chained-curl service exited with a 0/SUCCESS status"
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- 'service_chained_curl.status.ExecMainStatus == "0"'
|
||||
- 'curl_scheduled_service_chained_curl.status.ExecMainStatus == "0"'
|
||||
success_msg: "Service has exited with a 0/SUCCESS status"
|
||||
fail_msg: "Unexpected service status code: '{{ service_chained_curl.status.ExecMainStatus }}'"
|
||||
fail_msg: "Unexpected service status code: '{{ curl_scheduled_service_chained_curl.status.ExecMainStatus }}'"
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
vars:
|
||||
label: "{{ job.label }}"
|
||||
url: "{{ job.url }}"
|
||||
curl_cmd: "{{ job.curl_cmd | default(default_curl_cmd) }}"
|
||||
curl_args: "{{ job.curl_args | default(default_curl_args) }}"
|
||||
register: service
|
||||
curl_cmd: "{{ job.curl_cmd | default(curl_scheduled_curl_cmd) }}"
|
||||
curl_args: "{{ job.curl_args | default(curl_scheduled_curl_args) }}"
|
||||
register: curl_scheduled_service
|
||||
ansible.builtin.template:
|
||||
src: "placeholder.service"
|
||||
dest: "/etc/systemd/system/curl-{{ job.label }}.service"
|
||||
@@ -15,8 +15,8 @@
|
||||
- name: "Deploy-Service | Create systemd timer file: '{{ job.label }}'"
|
||||
vars:
|
||||
label: "{{ job.label }}"
|
||||
schedule: "{{ job.schedule | default(default_schedule) }}"
|
||||
register: timer
|
||||
schedule: "{{ job.schedule | default(curl_scheduled_schedule) }}"
|
||||
register: curl_scheduled_timer
|
||||
ansible.builtin.template:
|
||||
src: "placeholder.timer"
|
||||
dest: "/etc/systemd/system/curl-{{ job.label }}.timer"
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
- name: "Deploy-Service | Enable and start the timer: '{{ job.label }}'" # noqa: no-handler
|
||||
become: true
|
||||
when: service.changed or timer.changed
|
||||
when: curl_scheduled_service.changed or curl_scheduled_timer.changed
|
||||
ansible.builtin.systemd:
|
||||
name: "curl-{{ job.label }}.timer"
|
||||
state: started
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
kuma_port: "3001"
|
||||
curl_scheduled_kuma_port: "3001"
|
||||
|
||||
Reference in New Issue
Block a user