Skip to content

Commit

Permalink
Inject documentation before release using ansible-specdoc (#537)
Browse files Browse the repository at this point in the history
* adding stubs for doc injection

* stub missing files

* add quotes around range

* remove debug echo

* update docs and add inject-clean

* make format

* line too long

* updating to rich text

* add sanity check

* update specdoc
  • Loading branch information
jriddle-linode authored Jul 16, 2024
1 parent fb8c431 commit 52f47b5
Show file tree
Hide file tree
Showing 84 changed files with 568 additions and 75 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
- name: install ansible dependencies
run: ansible-galaxy collection install amazon.aws:==6.0.1

- name: inject docs using specdoc
run: make inject

- name: publish the collection
run: make publish
env:
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,12 @@ endif
@echo "api_url: $(TEST_API_URL)" >> $(INTEGRATION_CONFIG)
@echo "api_version: $(TEST_API_VERSION)" >> $(INTEGRATION_CONFIG)
@echo "ca_file: $(TEST_API_CA)" >> $(INTEGRATION_CONFIG)

inject:
@echo "Injecting documentation into source files"
for f in `ls ./plugins/modules/*.py`; do ansible-specdoc -j -i $$f; done
ansible-test sanity --test ansible-doc

inject-clean:
@echo "Removing injected documentation from source files"
for f in `ls ./plugins/modules/*.py`; do ansible-specdoc -jc -i $$f; done
2 changes: 1 addition & 1 deletion docs/modules/ipv6_range_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Get info about a Linode IPv6 range.
```yaml
- name: Get info about an IPv6 range
linode.cloud.ipv6_range_info:
range: 2600:3c01::
range: "2600:3c01::"
```
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/doc_fragments/ipv6_range_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
specdoc_examples = ['''
- name: Get info about an IPv6 range
linode.cloud.ipv6_range_info:
range: 2600:3c01::''']
range: "2600:3c01::"''']


result_range_samples = ['''{
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/account_availability_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,12 @@

SPECDOC_META = module.spec

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""

if __name__ == "__main__":
module.run()
7 changes: 7 additions & 0 deletions plugins/modules/account_availability_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,12 @@

SPECDOC_META = module.spec

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""

if __name__ == "__main__":
module.run()
7 changes: 7 additions & 0 deletions plugins/modules/account_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
},
)

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class Module(LinodeModuleBase):
"""Module for getting info about a Linode Account"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/api_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@
},
)

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class Module(LinodeModuleBase):
"""Module for running arbitrary Linode API requests"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/child_account_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,12 @@

SPECDOC_META = module.spec

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""

if __name__ == "__main__":
module.run()
7 changes: 7 additions & 0 deletions plugins/modules/child_account_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,12 @@

SPECDOC_META = module.spec

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""

if __name__ == "__main__":
module.run()
7 changes: 7 additions & 0 deletions plugins/modules/database_engine_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@
},
)

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class Module(LinodeModuleBase):
"""Module for getting a list of Managed Database engine types"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/database_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@
},
)

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class Module(LinodeModuleBase):
"""Module for getting info about a Linode databases"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/database_mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@

MUTABLE_FIELDS = {"allow_list", "updates"}

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class Module(LinodeModuleBase):
"""Module for creating and destroying Linode Databases"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/database_mysql_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@
},
)

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class Module(LinodeModuleBase):
"""Module for getting info about a Linode user"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/database_postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@

MUTABLE_FIELDS = {"allow_list", "updates"}

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class Module(LinodeModuleBase):
"""Module for creating and destroying Linode Databases"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/database_postgresql_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@
},
)

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class Module(LinodeModuleBase):
"""Module for getting info about a Linode PostgreSQL database"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@
"group",
}

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class LinodeDomain(LinodeModuleBase):
"""Module for creating and destroying Linode Domains"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/domain_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@

linode_domain_valid_filters = ["id", "domain"]

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class LinodeDomainInfo(LinodeModuleBase):
"""Module for getting info about a Linode Domain"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/domain_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@
},
)

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class Module(LinodeModuleBase):
"""Module for getting a list of domains"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/domain_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@
"weight",
}

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class LinodeDomainRecord(LinodeModuleBase):
"""Module for creating and destroying Linode Domain records"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/domain_record_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@
},
)

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class LinodeDomainRecordInfo(LinodeModuleBase):
"""Module for getting info about a Linode Domain record"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/event_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@
},
)

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class Module(LinodeModuleBase):
"""Module for getting info about a Linode events"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@
# Fields that can be updated on an existing Firewall
MUTABLE_FIELDS: List[str] = ["status", "tags"]

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class LinodeFirewall(LinodeModuleBase):
"""Module for creating and destroying Linode Firewalls"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/firewall_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@
},
)

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class LinodeFirewallDevice(LinodeModuleBase):
"""Module for managing Linode Firewall devices"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/firewall_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@

linode_firewall_valid_filters = ["id", "label"]

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class LinodeFirewallInfo(LinodeModuleBase):
"""Module for viewing info about a Linode Firewall"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/firewall_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@
},
)

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class Module(LinodeModuleBase):
"""Module for getting a list of Firewalls"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@

MUTABLE_FIELDS = {"description"}

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class Module(LinodeModuleBase):
"""Module for creating and destroying Linode Images"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/image_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
},
)

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class Module(LinodeModuleBase):
"""Module for getting info about a Linode user"""
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/image_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,12 @@

SPECDOC_META = module.spec

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""

if __name__ == "__main__":
module.run()
7 changes: 7 additions & 0 deletions plugins/modules/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,13 @@
"interfaces",
}

DOCUMENTATION = r"""
"""
EXAMPLES = r"""
"""
RETURN = r"""
"""


class LinodeInstance(LinodeModuleBase):
"""Module for creating and destroying Linode Instances"""
Expand Down
Loading

0 comments on commit 52f47b5

Please sign in to comment.