Skip to content

Commit 11f0311

Browse files
authored
implement nameserver, vlan and l2domain module (#13)
* fix documentation * Add nameserver module * Add nameserver test files * Modify `phpipam_helper.py` to work with tools controllers * add tar.gz to clean target * simplify tools controller handling * prepare helper for vlan * add vlan module * add vlan test files * add l2domain module * add l2domain test files * add special cases to `phpipam_helper` to fix issues with api * add documentation * prepare release
1 parent 47b67e3 commit 11f0311

27 files changed

+1408
-58
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"python.autoComplete.extraPaths": ["./tests/scripts"],
44
"python.envFile": "${workspaceFolder}/.env",
55
"python.linting.flake8Enabled": true,
6-
"python.linting.enabled": true
6+
"python.linting.enabled": true,
7+
"restructuredtext.confPath": "${workspaceFolder}/docs"
78
}

CHANGELOG.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ codeaffen.phpipam Release Notes
55
.. contents:: Topics
66

77

8+
v0.3.0
9+
======
10+
11+
New Modules
12+
-----------
13+
14+
- codeaffen.phpipam.domain - Manage L2 routing domains
15+
- codeaffen.phpipam.nameserver - Manage nameservers
16+
- codeaffen.phpipam.vlan - Manage vlans
17+
818
v0.2.0
919
======
1020

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ clean:
5252
find . -name '*.pyo' -exec rm -f {} +
5353
find . -name '*~' -exec rm -f {} +
5454
find . -name '__pycache__' -exec rm -rf {} +
55+
find . -name '*.tar.gz' -delete
5556

5657
doc-setup:
5758
pip install -r docs/requirements.txt

changelogs/changelog.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,15 @@ releases:
88
name: address
99
namespace: ''
1010
release_date: '2020-10-25'
11+
0.3.0:
12+
modules:
13+
- description: Manage L2 routing domains
14+
name: domain
15+
namespace: ''
16+
- description: Manage nameservers
17+
name: nameserver
18+
namespace: ''
19+
- description: Manage vlans
20+
name: vlan
21+
namespace: ''
22+
release_date: '2020-10-28'

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = u''
2828
# The full version, including alpha/beta/rc tags
29-
release = u'0.0.1'
29+
# release = u'0.0.1'
3030

3131

3232
# -- General configuration ---------------------------------------------------

docs/plugins/address_module.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Synopsis
4242

4343
.. Description
4444
45-
- create, update and delete sections
45+
- create, update and delete addresses
4646

4747
.. Aliases
4848

docs/plugins/domain_module.rst

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
.. Document meta
2+
3+
:orphan:
4+
5+
.. Anchors
6+
7+
.. _ansible_collections.codeaffen.phpipam.domain_module:
8+
9+
.. Anchors: short name for ansible.builtin
10+
11+
.. Anchors: aliases
12+
13+
14+
15+
.. Title
16+
17+
codeaffen.phpipam.domain -- Manage L2 routing domains
18+
+++++++++++++++++++++++++++++++++++++++++++++++++++++
19+
20+
.. Collection note
21+
22+
.. note::
23+
This plugin is part of the `codeaffen.phpipam collection <https://galaxy.ansible.com/codeaffen/phpipam>`_.
24+
25+
To install it use: :code:`ansible-galaxy collection install codeaffen.phpipam`.
26+
27+
To use it in a playbook, specify: :code:`codeaffen.phpipam.domain`.
28+
29+
.. version_added
30+
31+
.. versionadded:: 0.3.0 of codeaffen.phpipam
32+
33+
.. contents::
34+
:local:
35+
:depth: 1
36+
37+
.. Deprecated
38+
39+
40+
Synopsis
41+
--------
42+
43+
.. Description
44+
45+
- create, update and delete L2 routing domains
46+
47+
.. Aliases
48+
49+
50+
.. Requirements
51+
52+
Requirements
53+
------------
54+
The below requirements are needed on the host that executes this module.
55+
56+
- inflection
57+
- ipaddress
58+
- phpypam
59+
60+
61+
.. Options
62+
63+
Parameters
64+
----------
65+
66+
.. raw:: html
67+
68+
<table border=0 cellpadding=0 class="documentation-table">
69+
<tr>
70+
<th colspan="1">Parameter</th>
71+
<th>Choices/<font color="blue">Defaults</font></th>
72+
<th width="100%">Comments</th>
73+
</tr>
74+
<tr>
75+
<td colspan="1">
76+
<div class="ansibleOptionAnchor" id="parameter-app_id"></div>
77+
<b>app_id</b>
78+
<a class="ansibleOptionLink" href="#parameter-app_id" title="Permalink to this option"></a>
79+
<div style="font-size: small">
80+
<span style="color: purple">string</span>
81+
</div>
82+
</td>
83+
<td>
84+
<b>Default:</b><br/><div style="color: blue">"ansible"</div>
85+
</td>
86+
<td>
87+
<div>API app name</div>
88+
</td>
89+
</tr>
90+
<tr>
91+
<td colspan="1">
92+
<div class="ansibleOptionAnchor" id="parameter-description"></div>
93+
<b>description</b>
94+
<a class="ansibleOptionLink" href="#parameter-description" title="Permalink to this option"></a>
95+
<div style="font-size: small">
96+
<span style="color: purple">string</span>
97+
</div>
98+
</td>
99+
<td>
100+
</td>
101+
<td>
102+
<div>A descriptive text for that entity</div>
103+
</td>
104+
</tr>
105+
<tr>
106+
<td colspan="1">
107+
<div class="ansibleOptionAnchor" id="parameter-name"></div>
108+
<b>name</b>
109+
<a class="ansibleOptionLink" href="#parameter-name" title="Permalink to this option"></a>
110+
<div style="font-size: small">
111+
<span style="color: purple">string</span>
112+
/ <span style="color: red">required</span> </div>
113+
</td>
114+
<td>
115+
</td>
116+
<td>
117+
<div>Name of the given domain</div>
118+
</td>
119+
</tr>
120+
<tr>
121+
<td colspan="1">
122+
<div class="ansibleOptionAnchor" id="parameter-password"></div>
123+
<b>password</b>
124+
<a class="ansibleOptionLink" href="#parameter-password" title="Permalink to this option"></a>
125+
<div style="font-size: small">
126+
<span style="color: purple">string</span>
127+
/ <span style="color: red">required</span> </div>
128+
</td>
129+
<td>
130+
</td>
131+
<td>
132+
<div>Password of the user to access phpIPAM server</div>
133+
</td>
134+
</tr>
135+
<tr>
136+
<td colspan="1">
137+
<div class="ansibleOptionAnchor" id="parameter-sections"></div>
138+
<b>sections</b>
139+
<a class="ansibleOptionLink" href="#parameter-sections" title="Permalink to this option"></a>
140+
<div style="font-size: small">
141+
<span style="color: purple">list</span>
142+
/ <span style="color: purple">elements=string</span> </div>
143+
</td>
144+
<td>
145+
</td>
146+
<td>
147+
<div>List of sections where the nameserver appears</div>
148+
</td>
149+
</tr>
150+
<tr>
151+
<td colspan="1">
152+
<div class="ansibleOptionAnchor" id="parameter-server_url"></div>
153+
<b>server_url</b>
154+
<a class="ansibleOptionLink" href="#parameter-server_url" title="Permalink to this option"></a>
155+
<div style="font-size: small">
156+
<span style="color: purple">string</span>
157+
/ <span style="color: red">required</span> </div>
158+
</td>
159+
<td>
160+
</td>
161+
<td>
162+
<div>URL of the phpIPAM server</div>
163+
</td>
164+
</tr>
165+
<tr>
166+
<td colspan="1">
167+
<div class="ansibleOptionAnchor" id="parameter-state"></div>
168+
<b>state</b>
169+
<a class="ansibleOptionLink" href="#parameter-state" title="Permalink to this option"></a>
170+
<div style="font-size: small">
171+
<span style="color: purple">string</span>
172+
</div>
173+
</td>
174+
<td>
175+
<ul style="margin: 0; padding: 0"><b>Choices:</b>
176+
<li><div style="color: blue"><b>present</b>&nbsp;&larr;</div></li>
177+
<li>absent</li>
178+
</ul>
179+
</td>
180+
<td>
181+
<div>State of the entity</div>
182+
</td>
183+
</tr>
184+
<tr>
185+
<td colspan="1">
186+
<div class="ansibleOptionAnchor" id="parameter-username"></div>
187+
<b>username</b>
188+
<a class="ansibleOptionLink" href="#parameter-username" title="Permalink to this option"></a>
189+
<div style="font-size: small">
190+
<span style="color: purple">string</span>
191+
/ <span style="color: red">required</span> </div>
192+
</td>
193+
<td>
194+
</td>
195+
<td>
196+
<div>Username to access phpIPAM server</div>
197+
</td>
198+
</tr>
199+
</table>
200+
<br/>
201+
202+
.. Notes
203+
204+
205+
.. Seealso
206+
207+
208+
.. Examples
209+
210+
Examples
211+
--------
212+
213+
.. code-block:: yaml+jinja
214+
215+
216+
- name: "Create domain"
217+
codeaffen.phpipam.domain:
218+
username: "admin"
219+
password: "s3cr3t"
220+
server_url: "https://ipam.example.com"
221+
name: "my domain"
222+
sections:
223+
- Example Inc.
224+
- DEVOPS department
225+
state: present
226+
227+
- name: "Remove domain"
228+
codeaffen.phpipam.domain:
229+
username: "admin"
230+
password: "s3cr3t"
231+
server_url: "https://ipam.example.com"
232+
name: "my domain"
233+
state: absent
234+
235+
236+
237+
238+
.. Facts
239+
240+
241+
.. Return values
242+
243+
244+
.. Status (Presently only deprecated)
245+
246+
247+
.. Authors
248+
249+
Authors
250+
~~~~~~~
251+
252+
- Christian Meißner (@cmeissner)
253+
254+
255+
256+
.. Parsing errors
257+

docs/plugins/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ Module Plugins
1515
--------------
1616

1717
* :ref:`address <ansible_collections.codeaffen.phpipam.address_module>` -- Manage addresses
18+
* :ref:`domain <ansible_collections.codeaffen.phpipam.domain_module>` -- Manage L2 routing domains
19+
* :ref:`nameserver <ansible_collections.codeaffen.phpipam.nameserver_module>` -- Manage nameservers
1820
* :ref:`section <ansible_collections.codeaffen.phpipam.section_module>` -- Manage sections
1921
* :ref:`subnet <ansible_collections.codeaffen.phpipam.subnet_module>` -- Manage subnets
22+
* :ref:`vlan <ansible_collections.codeaffen.phpipam.vlan_module>` -- Manage vlans
2023

2124

2225
.. seealso::

0 commit comments

Comments
 (0)