summaryrefslogtreecommitdiffstats
path: root/roles/openshift_certificate_expiry/tasks/main.yml
blob: b5234bd1ec6fa1d6c0fd6666c8274eb81526245d (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
  become: no
  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: 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
  become: no
  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