summaryrefslogtreecommitdiffstats
path: root/roles/openshift_certificate_expiry/tasks/main.yml
blob: 7062b5060c56448a5c427cce63efe6fad7037dfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
- name: Check cert expirys on host
  openshift_cert_expiry:
    warning_days: "{{ openshift_certificate_expiry_warning_days|int }}"
    config_base: "{{ openshift_certificate_expiry_config_base }}"
    show_all: "{{ openshift_certificate_expiry_show_all|bool }}"
  register: check_results

- name: Generate expiration report HTML
  run_once: yes
  template:
    src: cert-expiry-table.html.j2
    dest: "{{ openshift_certificate_expiry_html_report_path }}"
  delegate_to: localhost
  when: openshift_certificate_expiry_generate_html_report|bool

- name: Generate the result JSON string
  run_once: yes
  set_fact:
    # oo_cert_expiry_results_to_json is a custom filter in role lib_utils
    json_result_string: "{{ hostvars|oo_cert_expiry_results_to_json(play_hosts) }}"
  when: openshift_certificate_expiry_save_json_results|bool

- name: Generate results JSON file
  run_once: yes
  template:
    src: save_json_results.j2
    dest: "{{ openshift_certificate_expiry_json_results_path }}"
  delegate_to: localhost
  when: openshift_certificate_expiry_save_json_results|bool