Skip to content

Commit

Permalink
Documented some vars for adhoc playbook for openshift pv
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Arrotin <[email protected]>
  • Loading branch information
arrfab committed Jun 16, 2020
1 parent d4aca01 commit c30289b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
6 changes: 5 additions & 1 deletion adhoc-openshift-pv.yml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
24 changes: 24 additions & 0 deletions role-ocp-admin-node.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c30289b

Please sign in to comment.