Skip to content

Commit 41f4646

Browse files
authored
refactor base documentation (#7)
1 parent 92af8f3 commit 41f4646

File tree

5 files changed

+83
-30
lines changed

5 files changed

+83
-30
lines changed

README.md

Lines changed: 78 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ Current documentation can be found on [readthedocs.io](https://phpipam-ansible-m
3434
If you have installed the collection you can facilitate `ansible-doc` to display documentation for a given module.
3535

3636
```bash
37-
$ ansible-doc codeaffen.phpipam.subnet
38-
> SUBNET (/home/user/ansible_collections/codeaffen/phpipam/plugins/modules/subnet.py)
37+
$ ansible-doc codeaffen.phpipam.section
38+
> SECTION (/home/user/ansible_collections/codeaffen/phpipam/plugins/modules/section.py)
3939

40-
create, update and delete subnets
40+
create, update and delete sections
4141

4242
* This module is maintained by The Ansible Community
4343
OPTIONS (= is mandatory):
@@ -47,28 +47,84 @@ OPTIONS (= is mandatory):
4747
[Default: ansible]
4848
type: str
4949

50-
= cidr
51-
Subnet in CIDR notation
50+
- description
51+
Short describtive text
52+
[Default: None]
53+
type: str
54+
55+
- dns_resolver
56+
The NS resolver to be used for this section
57+
[Default: (null)]
58+
type: str
5259

60+
- list_order
61+
Order in sections list view
62+
[Default: (null)]
63+
type: int
64+
65+
= name
66+
Name of the section
67+
68+
example: customer_1
69+
type: str
70+
71+
- parent
72+
Name of the parent section
73+
(Aliases: master, master_section)[Default: None]
5374
type: str
5475

5576
= password
5677
Password of the user to access phpIPAM server
5778

5879
type: str
5980

81+
- permissions
82+
JSON object that represent the permissions for each user
83+
[Default: None]
84+
type: json
85+
6086
= server_url
6187
URL of the phpIPAM server
6288

6389
type: str
6490

91+
- show_supernets_only
92+
Show only supernets in sebnet list view
93+
[Default: False]
94+
type: bool
95+
96+
- show_vlan
97+
Show/hide VLANs in subnet list view
98+
[Default: False]
99+
type: bool
100+
101+
- show_vrf
102+
Show/hide VRFs in subnet list view
103+
[Default: False]
104+
type: bool
105+
106+
- state
107+
State of the entity
108+
(Choices: present, absent)[Default: present]
109+
type: str
110+
111+
- strict_mode
112+
If set to true, consistency of subnets and IP addresses will be checked
113+
[Default: False]
114+
type: bool
115+
116+
- subnet_ordering
117+
How to order subnets within this section
118+
[Default: subnet,asc]
119+
type: str
120+
65121
= username
66122
Username to access phpIPAM server
67123

68124
type: str
69125

70126

71-
REQUIREMENTS: phpipam-client
127+
REQUIREMENTS: inflection, ipaddress, phpypam
72128

73129
AUTHOR: Christian Meißner (@cmeissner)
74130
METADATA:
@@ -79,26 +135,24 @@ AUTHOR: Christian Meißner (@cmeissner)
79135

80136
EXAMPLES:
81137

82-
- name: "Create a subnet"
83-
cmeissner.phpipam.subnet:
138+
- name: "Create a section"
139+
codeaffen.phpipam.section:
84140
username: "admin"
85141
password: "s3cr3t"
86142
server_url: "https://ipam.example.com"
87-
cidr: "192.0.2.128/25"
143+
name: "EXAMPLE INC"
144+
description: "Section for company EXAMPLE INC"
88145
state: present
89146

90-
91-
RETURN VALUES:
92-
93-
entity:
94-
description: Final state of the affected entities grouped by their type.
95-
returned: success
96-
type: dict
97-
contains:
98-
subnets:
99-
description: List of subnets.
100-
type: list
101-
elements: dicts
147+
- name: "Create a section with parent"
148+
codeaffen.phpipam.section:
149+
username: "admin"
150+
password: "s3cr3t"
151+
server_url: "https://ipam.example.com"
152+
name: "DEVOPS department"
153+
parent: "EXAMPLE INC"
154+
description: "Section for devops department in EXAMPLE INC"
155+
state: present
102156
```
103157

104158
### repository folder
@@ -109,5 +163,6 @@ A last option to read the docs is the [docs](docs) folder in this repository.
109163

110164
The following dependencies have to be fulfiled by the Ansible controller.
111165

112-
* phpipam-client
113-
* PyYAML
166+
* inflection
167+
* ipaddress
168+
* phpypam

doc_fragments/phpipam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ModuleDocFragment(object):
2121
# phpIPAM documentation fragment
2222
DOCUMENTATION = '''
2323
requirements:
24-
- phpipam-client
24+
- phpypam
2525
options:
2626
server_url:
2727
description: URL of the phpIPAM server

docs/CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

plugins/doc_fragments/phpipam.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ class ModuleDocFragment(object):
2222
# phpIPAM documentation fragment
2323
DOCUMENTATION = '''
2424
requirements:
25-
- phpipam-client
26-
- json
2725
- inflection
28-
- PyYAML
26+
- ipaddress
27+
- phpypam
2928
options:
3029
server_url:
3130
description: URL of the phpIPAM server

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
phpypam
2-
PyYAML
31
inflection
2+
ipaddress
3+
phpypam

0 commit comments

Comments
 (0)