Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
:param options: options passed to main binary
:return:
"""
if not which("ansible-playbook"):
print("# skipping ansible per missing ansible-playbook binary.")
return
playbooksdir = os.path.join(citellus.citellusdir, PlaybooksFolder)
playbooks = citellus.findplugins(folders=[playbooksdir], include=options.include, exclude=options.exclude,
executables=False, extension=".yml")
playbooklive = []
playbooksnap = []
for playbook in playbooks:
if citellus.regexpfile(file=playbook, regexp="CITELLUS_ROOT"):
playbooksnap.append(playbook)
else:
playbooklive.append(playbook)
# Restrict the playbooks to process to the running mode
if options.live is True:
playbooks = playbooklive
playbookskipped = playbooksnap
else:
playbooks = playbooksnap
playbookskipped = playbooklive
# There are plugins that can be run in Live and Snapshot mode (Find string CITELLUS_HYBRID), by default the Hybrid
# ones will be flagged as snapshot mode, so we only process them in case we're running live.
if options.live is True: