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