Skip to content

Commit

Permalink
add disclaimer and fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jriddle-linode committed Sep 11, 2023
1 parent 04b55d6 commit 86f70e4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
9 changes: 8 additions & 1 deletion docs/modules/ip_assign.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Assign IPs to Linodes in a given Region.

The following restrictions apply:

- All Linodes involved must have at least one public IPv4 address after assignment.

- Linodes may have no more than one assigned private IPv4 address.

- Linodes may have no more than one assigned IPv6 range.

- [Examples](#examples)
- [Parameters](#parameters)
- [Return Values](#return-values)
Expand All @@ -10,7 +18,6 @@ Assign IPs to Linodes in a given Region.

```yaml
- name: Assign IP to Linode
linode.cloud.ip_assign:
linode.cloud.ip_assign:
region: us-east
assignments:
Expand Down
12 changes: 10 additions & 2 deletions plugins/modules/ip_assign.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
)
from ansible_specdoc.objects import FieldType, SpecDocMeta, SpecField
from linode_api4 import Instance
from linode_api4.objects.base import MappedObject

linode_ip_assignments_spec: dict = {
"address": SpecField(
Expand Down Expand Up @@ -53,7 +54,14 @@
}

SPECDOC_META = SpecDocMeta(
description=["Assign IPs to Linodes in a given Region."],
description=[
"Assign IPs to Linodes in a given Region.",
"The following restrictions apply:",
" - All Linodes involved must have at least"
" one public IPv4 address after assignment.",
" - Linodes may have no more than one assigned private IPv4 address.",
" - Linodes may have no more than one assigned IPv6 range.",
],
requirements=global_requirements,
author=global_authors,
options=spec,
Expand All @@ -73,7 +81,7 @@ def __init__(self) -> None:
}
super().__init__(module_arg_spec=self.module_arg_spec)

def flatten_ips(self, ips):
def flatten_ips(self, ips: MappedObject) -> list:
"""Flatten a linodes IPs to quickly check the assignment"""
addrs = [
v.address
Expand Down

0 comments on commit 86f70e4

Please sign in to comment.