|
9 | 9 | when:
|
10 | 10 | - directory is undefined or (directory | trim) == ""
|
11 | 11 |
|
12 |
| - - name: Read Engagement Data |
| 12 | + - name: 'Read Engagement Data' |
13 | 13 | include_vars:
|
14 | 14 | file: "{{ directory }}/engagement.json"
|
15 | 15 |
|
16 |
| - - name: Combine customer and engagement name |
| 16 | + - name: 'Combine customer and engagement name' |
17 | 17 | set_fact:
|
18 | 18 | customer_engagement: "{{ customer_name | lower | replace(' ', '_') }}-{{ project_name | lower | replace(' ', '_') }}"
|
19 | 19 |
|
20 |
| - - name: Residency Engagement Type inventory |
21 |
| - block: |
| 20 | + - name: 'Pre-process timestamps' |
| 21 | + set_fact: |
| 22 | + - archive_date_in_seconds: "{{ (archive_date | default('2000-01-01T') | regex_replace('^(.*)T.*$', '\\1') | to_datetime('%Y-%m-%d')).strftime('%s') }}" |
| 23 | + - time_now_in_seconds: "{{ now(utc=true, fmt='%s') }}" |
| 24 | + |
| 25 | + - name: 'Residency Engagement Type inventory' |
| 26 | + block:` |
22 | 27 | - name: "Write inventory to file"
|
23 | 28 | template:
|
24 | 29 | src: "residency-tower-management-host.yaml.j2"
|
|
31 | 36 | when:
|
32 | 37 | - start_date is defined
|
33 | 38 | - engagement_type | default('') == 'Residency'
|
34 |
| - - (archive_date | default('2006-01-02T15:04:05Z') | to_datetime('%Y-%m-%dT%H:%M:%SZ')).strftime('%s') > now(utc=true).strftime('%s') |
| 39 | + - archive_date_in_seconds > time_now_in_seconds |
35 | 40 |
|
36 |
| - - name: DO500 Engagement Type inventory |
| 41 | + - name: 'DO500 Engagement Type inventory' |
37 | 42 | block:
|
38 | 43 | - name: "Write inventory to file"
|
39 | 44 | template:
|
|
47 | 52 | when:
|
48 | 53 | - start_date is defined
|
49 | 54 | - engagement_type | default('') == 'DO500'
|
50 |
| - - (archive_date | default('2006-01-02T15:04:05Z') | to_datetime('%Y-%m-%dT%H:%M:%SZ')).strftime('%s') > now(utc=true).strftime('%s') |
| 55 | + - archive_date_in_seconds > time_now_in_seconds |
0 commit comments