diff --git a/adhoc-openshift-pv.yml b/adhoc-openshift-pv.yml index bc3b7b6..6edf64c 100644 --- a/adhoc-openshift-pv.yml +++ b/adhoc-openshift-pv.yml @@ -1,7 +1,11 @@ --- # This playbook is to create a persistent volume for openshift CI namespace +# Needed variables as extra-vars: +# - pv_size (like 100Gi) +# - cico_project_name (registry) +# - host (where to execute command, like ocp-admin.ci.centos.org) # Example to run the playbook -# ansible-playbook-ci playbooks/adhoc-openshift-pv.yml -e "env_prefix=ocp-stg" -e "host=n4-136.cloud.ci.centos.org" -e "pv_size=10Gi" -e "cico_project_name=test" +# ansible-playbook-ci playbooks/adhoc-openshift-pv.yml -e "host=n4-136.cloud.ci.centos.org" -e "pv_size=10Gi" -e "cico_project_name=test" # The node on which we'll run this should have the exported NFS volume mounted locally # using variables from inventory: # ocp_nfs_server: (like node.domain) diff --git a/role-ocp-admin-node.yml b/role-ocp-admin-node.yml new file mode 100644 index 0000000..9cc7557 --- /dev/null +++ b/role-ocp-admin-node.yml @@ -0,0 +1,24 @@ +--- +- hosts: hostgroup-role-ocp-admin-node + become: True + pre_tasks: + - name: Checking if no-ansible file is there + stat: + path: /etc/no-ansible + register: no_ansible + + - name: Verifying if we can run ansible or not + assert: + that: + - "not no_ansible.stat.exists" + msg: "/etc/no-ansible file exists so skipping ansible run on this node" + + roles: + - ocp-admin-node + + post_tasks: + - name: Touching ansible-run (monitored by Zabbix) + file: + path: /var/log/ansible.run + state: touch +