Skip to content
Permalink
Browse files

feat: added conf variable for ignoring clouds on foreman_heal

foreman_rbac_exclude to take cloud names as "cloud32|cloud04" to
be excluded from foreman_heal.

Change-Id: Ic72e735faa21f5a725cc1371364c963072041d78
  • Loading branch information
grafuls committed Nov 15, 2019
1 parent e18daaa commit 198b5ef9daa81f2324477200282c6a0c97d81bf1
Showing with 8 additions and 2 deletions.
  1. +6 −1 conf/quads.yml
  2. +2 −1 quads/tools/foreman_heal.py
@@ -89,9 +89,14 @@ foreman_default_medium: "RHEL Local"
# set the following variable to true if you want this functionality
foreman_check_host_health:

# Foreman RBAC fix ignore
# variable to pass cloud names to be excluded from foreman_heal
# with values separated by pipes ('cloud32|cloud04')
foreman_rbac_exclude:

# omit these hosts (used for wiki generation)
# These are typically hosts known to your foreman that you don't
# want to pull into the wiki. (this is a regexp, e.g. 'host1|host2'
# want to pull into the wiki. (this is a regexp, e.g. 'host1|host2')
exclude_hosts: cyclades|s4810|z9000|5548|foreman|c08-h30-r630|c08-h05-r930|b08-|e05-h25|zfs01

# Foreman naming convention is <rack>-<u-location>-<type>
@@ -24,9 +24,10 @@ def main():
loop=loop,
)

ignore = conf["foreman_rbac_exclude"].split("|")
clouds = Cloud.objects()
for cloud in clouds:
if cloud.name != "cloud01":
if cloud.name != "cloud01" and cloud.name not in ignore:
logger.info(f"Processing {cloud.name}")
user_id = loop.run_until_complete(foreman.get_user_id(cloud.name))
roles = loop.run_until_complete(foreman.get_user_roles(user_id))

0 comments on commit 198b5ef

Please sign in to comment.
You can’t perform that action at this time.