mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
Merge pull request #544 from t-woerner/ansible_doc_test__fix_ansible_library
ansible-doc-test: ANSIBLE_LIBRARY needs to be set internally
This commit is contained in:
4
.github/workflows/docs.yml
vendored
4
.github/workflows/docs.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
- name: Run ansible-doc-test
|
||||
run: |
|
||||
python -m pip install "ansible < 2.10"
|
||||
ANSIBLE_LIBRARY="." python utils/ansible-doc-test roles plugins
|
||||
ANSIBLE_LIBRARY="." python utils/ansible-doc-test -v roles plugins
|
||||
|
||||
check_docs_latest:
|
||||
name: Check Ansible Documentation with latest Ansible.
|
||||
@@ -28,5 +28,5 @@ jobs:
|
||||
- name: Run ansible-doc-test
|
||||
run: |
|
||||
python -m pip install ansible
|
||||
ANSIBLE_LIBRARY="." python utils/ansible-doc-test roles plugins
|
||||
ANSIBLE_LIBRARY="." python utils/ansible-doc-test -v roles plugins
|
||||
|
||||
|
||||
@@ -26,6 +26,6 @@ repos:
|
||||
- id: ansible-doc-test
|
||||
name: Verify Ansible roles and module documentation.
|
||||
language: python
|
||||
entry: env ANSIBLE_LIBRARY=./plugins/modules utils/ansible-doc-test
|
||||
entry: utils/ansible-doc-test
|
||||
# args: ['-v', 'roles', 'plugins']
|
||||
files: ^.*.py$
|
||||
|
||||
@@ -29,12 +29,16 @@ import subprocess
|
||||
|
||||
def run_ansible_doc(role, module, verbose=False):
|
||||
playbook_dir, module_path = get_playbook_dir(role, module)
|
||||
module_dir = os.path.dirname(module_path)
|
||||
|
||||
command = ["ansible-doc",
|
||||
command = ["env",
|
||||
"ANSIBLE_LIBRARY=%s" % module_dir,
|
||||
"ansible-doc",
|
||||
"--playbook-dir=%s" % playbook_dir,
|
||||
"--type=module",
|
||||
"-vvv",
|
||||
module]
|
||||
|
||||
process = subprocess.run(command,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
|
||||
Reference in New Issue
Block a user