feat(api): Create and end a session

!1
This commit is contained in:
2023-07-28 15:15:33 +09:30
parent 15573f03cd
commit febce3aa5e
3 changed files with 30 additions and 1 deletions

18
tasks/api/api.yaml Normal file
View File

@ -0,0 +1,18 @@
---
- name: Always End Session
block:
- name: Start Session
ansible.builtin.include_tasks:
file: api/session-create.yaml
when: glpi.api.session | default('') == ''
always:
- name: End Session
ansible.builtin.include_tasks:
file: api/session-end.yaml
when: glpi_session_get.status | default(0) | int == 200

View File

@ -13,7 +13,6 @@
not glpi_installed | bool
- name: Configure Log Rotate
ansible.builtin.include_tasks:
file: configure.yaml
@ -31,3 +30,11 @@
# and
# logrotate | default([]) | length | int > 0
# )
- name: API tasks
ansible.builtin.include_tasks:
file: api/api.yaml
apply:
tags:
- always
when: glpi_config_as_code_json length | int > 0