mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 07:18:09 +02:00
Implemented logic to don't generate everytime a new version and instead use the template modification timestamp
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
- name: Get the current Unix timestamp as version
|
||||
set_fact:
|
||||
global_css_version: "{{ ansible_date_time.epoch }}"
|
||||
when: run_once_nginx_global_css is not defined
|
||||
|
||||
- name: Ensure {{nginx.directories.global}} directory exists
|
||||
file:
|
||||
path: "{{nginx.directories.global}}"
|
||||
@@ -21,8 +16,18 @@
|
||||
mode: '0644'
|
||||
when: run_once_nginx_global_css is not defined
|
||||
|
||||
- name: run the global css tasks once
|
||||
set_fact:
|
||||
run_once_nginx_global_css: true
|
||||
- name: Get stat for global.css destination file
|
||||
stat:
|
||||
path: "{{ global_css_destination }}"
|
||||
register: global_css_stat
|
||||
when: run_once_nginx_global_css is not defined
|
||||
|
||||
- name: Set global_css_version to file modification time
|
||||
set_fact:
|
||||
global_css_version: "{{ global_css_stat.stat.mtime }}"
|
||||
when: run_once_nginx_global_css is not defined
|
||||
|
||||
- name: Mark global css tasks as run once
|
||||
set_fact:
|
||||
run_once_nginx_global_css: true
|
||||
when: run_once_nginx_global_css is not defined
|
Reference in New Issue
Block a user