Browse Source

[autodoc] guessing converge playbook

If a molecule has a defined converge playbook, we should use it instead
of defaulting to the role's playbook.

Change-Id: Idc55fba78ce91d472ed367f5097505c9a5d9b6dd
changes/58/774758/7
David Vallee Delisle 1 year ago
parent
commit
98791eafff
  1. 12
      doc/source/_exts/ansible-autodoc.py

12
doc/source/_exts/ansible-autodoc.py

@ -238,6 +238,7 @@ class AnsibleAutoPluginDirective(Directive):
)
)
default_playbook = [molecule_path, test, 'converge.yml']
provisioner_data = molecule_conf.get('provisioner')
if provisioner_data:
inventory = provisioner_data.get('inventory')
@ -248,12 +249,13 @@ class AnsibleAutoPluginDirective(Directive):
section_title='Molecule Inventory'
)
)
try:
converge = provisioner_data['playbooks']['converge']
default_playbook = default_playbook[:-1] + [converge]
except KeyError:
pass
molecule_playbook_path = os.path.join(
molecule_path,
test,
'converge.yml'
)
molecule_playbook_path = os.path.join(*default_playbook)
with open(molecule_playbook_path) as f:
molecule_playbook = yaml.safe_load(f.read())
molecule_section.append(

Loading…
Cancel
Save