Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

12.2.2. 运行证书过期 Playbook

OpenShift Container Platform 安装程序提供一组示例证书过期 playbook,它使用了 openshift_certificate_expiry 角色的不同配置集合。

这些 playbook 必须与代表集群 的清单文件 一起使用。要获得最佳结果,请使用 -v 选项运行 ansible-playbook

使用 easy-mode.yaml 示例 playbook,您可以根据需要尝试角色在对规格进行调整。此 playbook:

  • $HOME 目录中生成 JSON 和 stylized HTML 报告。
  • 将警告窗口设置得非常大,以保证您将总能得到结果。
  • 在结果中包含所有证书(健康或非 )。

进入 playbook 目录并运行 easy-mode.yaml playbook:

$ cd /usr/share/ansible/openshift-ansible
$ ansible-playbook -v -i <inventory_file> \
    playbooks/openshift-checks/certificate_expiry/easy-mode.yaml
其他 Playbook 示例

其它示例 playbook 还可用于直接从 /usr/share/ansible/openshift-ansible/playbooks/certificate_expiry/ 目录运行。

表 12.3. 其他 Playbook 示例

文件名使用方法

default.yaml

生成 openshift_certificate_expiry 角色的默认行为。

html_and_json_default_paths.yaml

在默认路径中生成 HTML 和 JSON 工件。

longer_warning_period.yaml

将到期警告窗口更改为 1500 天。

longer-warning-period-json-results.yaml

将过期警告窗口更改为 1500 天,并将结果保存为 JSON 文件。

运行其中任何示例 playbook:

$ cd /usr/share/ansible/openshift-ansible
$ ansible-playbook -v -i <inventory_file> \
    playbooks/openshift-checks/certificate_expiry/<playbook>