From cdce2cc45e1a8c9e7009f9777e8fd4a9189f82dc Mon Sep 17 00:00:00 2001 From: nazunalika Date: Mon, 4 Jan 2021 01:38:13 -0700 Subject: [PATCH] keytab checks --- ansible/playbooks/role-rocky-kojid.yml | 13 +++++++++ ansible/playbooks/role-rocky-kojihub.yml | 34 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/ansible/playbooks/role-rocky-kojid.yml b/ansible/playbooks/role-rocky-kojid.yml index 78dbdab..75bd9ef 100644 --- a/ansible/playbooks/role-rocky-kojid.yml +++ b/ansible/playbooks/role-rocky-kojid.yml @@ -24,6 +24,19 @@ success_msg: "We are able to run on this node" fail_msg: "/etc/no-ansible exists - skipping run on this node" + - name: Check for keytabs - kojid + stat: + path: /etc/kojid.keytab + register: kojid_keytab + changed_when: "1 != 1" + + - name: Verify keytab + assert: + that: + - "kojid_keytab.stat.exists" + success_msg: "It is likely we have all keytabs" + fail_msg: "There are no keytabs. Please build the keytabs." + # EPEL and PowerTools are required for ipsilon to function # I also couldn't find an ansible built-in to do this - name: Enable the PowerTools repository diff --git a/ansible/playbooks/role-rocky-kojihub.yml b/ansible/playbooks/role-rocky-kojihub.yml index 989d311..81ddd7e 100644 --- a/ansible/playbooks/role-rocky-kojihub.yml +++ b/ansible/playbooks/role-rocky-kojihub.yml @@ -24,6 +24,40 @@ success_msg: "We are able to run on this node" fail_msg: "/etc/no-ansible exists - skipping run on this node" + - name: Check for keytabs - web + stat: + path: /etc/keytabs/koji-web.keytab + register: koji_keytab + changed_when: "1 != 1" + + - name: Check for keytabs - kojira + stat: + path: /etc/keytabs/kojira.keytab + register: kojira_keytab + changed_when: "1 != 1" + + - name: Check for keytabs - gc + stat: + path: /etc/keytabs/koji-gc.keytab + register: gc_keytab + changed_when: "1 != 1" + + - name: Check for keytabs - host + stat: + path: /etc/keytabs/host.keytab + register: host_keytab + changed_when: "1 != 1" + + - name: Verify keytab + assert: + that: + - "koji_keytab.stat.exists" + - "kojira_keytab.stat.exists" + - "gc_keytab.stat.exists" + - "host_keytab.stat.exists" + success_msg: "It is likely we have all keytabs" + fail_msg: "There are no keytabs. Please build the keytabs." + # EPEL and PowerTools are required for ipsilon to function # I also couldn't find an ansible built-in to do this - name: Enable the PowerTools repository