This repository has been archived by the owner on May 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build_docs.yml
55 lines (42 loc) · 1.6 KB
/
build_docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
- name: Build multi-vendor docs
hosts: all
connection: local
gather_facts: no
tasks:
- name: Clean residual Vendor folders
file: name=docs/{{ vendor }} state=absent
ignore_errors: true
- name: Recreate Vendor folders
file: name=docs/{{ vendor }} state=directory mode=0755
- name: Create Vendor pages
template: src=templates/vendor_page.tmpl dest=docs/{{ vendor }}/vendor_page.rst
- set_fact:
repo_path=repos/{{ url | basename | replace('.git', '') }}
- name: Get Ansible Repo
git: repo={{ url }} dest={{ repo_path }} update=yes
- name: Make Ansible Docs
docgen:
module_dir: "{{ repo_path }}/{{ module_path }}"
output_dir: docs/{{ vendor }}/{{ inventory_hostname }}
make_index: false
modules_title: "{{ inventory_hostname }}"
- name: Add Source Link
lineinfile:
dest: docs/{{ vendor }}/{{ inventory_hostname }}/modules_list.rst
insertbefore: '.. toctree::'
line: 'These docs were dynamically created from the modules that can be found `here\n<{{ url }}>`_.\n'
- name: Link Ansible Docs to Vendor Page
lineinfile:
dest: docs/{{ vendor }}/vendor_page.rst
line: ' {{ inventory_hostname }}<{{ inventory_hostname }}/modules_list>'
insertafter: EOF
- name: Create Index File
template: src=templates/index.tmpl dest=docs/index.rst
run_once: true
- name: Make Clean
command: /usr/bin/make clean chdir=docs/
run_once: true
- name: Make HTML
command: /usr/bin/make html chdir=docs/
run_once: true