diff --git a/playbooks/agent.yaml b/playbooks/agent.yaml index 9a319ed..1be6bdc 100644 --- a/playbooks/agent.yaml +++ b/playbooks/agent.yaml @@ -87,4 +87,3 @@ api_scanagents: tools/scanagents nfc_c_path_cache: "{{ playbook_dir }}/../cache" nfc_c_cache_expire_time: 1800 - nfc_c_epoch_time_offset: "{{ -((3600 * 9) + 1800 | int) | int }}" diff --git a/playbooks/tasks/api_call.yaml b/playbooks/tasks/api_call.yaml index aac94d6..9c9ef8b 100644 --- a/playbooks/tasks/api_call.yaml +++ b/playbooks/tasks/api_call.yaml @@ -31,7 +31,7 @@ - name: Expire ansible.builtin.set_fact: - expired: "{{ ((epoch | int + nfc_c_epoch_time_offset | int) >= ((cache_files.stat.mtime | int) + nfc_c_cache_expire_time | int) | int ) | bool }}" + expired: "{{ ((epoch | int + (nfc_c_epoch_time_offset | default(0)) | int) >= ((cache_files.stat.mtime | int) + nfc_c_cache_expire_time | int) | int ) | bool }}" when: cache_files.stat.exists @@ -41,7 +41,7 @@ - "exists: {{ cache_files.stat.exists | default('') }}" - "mtime: {{ cache_files.stat.mtime | default(0) | int }}" - "expire: {{ (cache_files.stat.mtime | int) + nfc_c_cache_expire_time | int }}" - - "epoch: {{ (epoch | int + nfc_c_epoch_time_offset | int) | int }} [{{ nfc_c_cache_expire_time }}]" + - "epoch: {{ (epoch | int + (nfc_c_epoch_time_offset | default(0)) | int) | int }} [{{ nfc_c_cache_expire_time }}]" - "epoch: {{ epoch }}" - "expired: {{ expired }}" when: cache_files.stat.exists