Feature Request: Generate correct devices IP address in ansible inventory #2

Closed
opened 2024-06-24 11:49:45 +02:00 by tom · 1 comment
Owner

Is your feature request related to a problem? Please describe.

Add process to generate devices IP address based on oob_network in ansible inventory and group_vars.

Describe the solution you would like

An approach similar to ansible method would be OK:

# Returns from the start of the range
# {{ test_list | ansible.utils.ipaddr('net') | ansible.utils.ipaddr('200') }}
['192.168.32.200/24', '2001:db8:32c:faad::c8/64']

Additional context

N/A

**Is your feature request related to a problem? Please describe.** Add process to generate devices IP address based on `oob_network` in ansible inventory and group_vars. **Describe the solution you would like** An approach similar to ansible method would be OK: ```python # Returns from the start of the range # {{ test_list | ansible.utils.ipaddr('net') | ansible.utils.ipaddr('200') }} ['192.168.32.200/24', '2001:db8:32c:faad::c8/64'] ``` **Additional context** N/A
tom self-assigned this 2024-06-24 11:49:45 +02:00
Author
Owner

Using a local extension like:

  • reference extension
{
    "project_slug": "Foobar",
    "year": "{% now 'utc', '%Y' %}",
    "_extensions": ["local_extensions.simplefilterextension"]
}
  • Python code example
from cookiecutter.utils import simple_filter

@simple_filter
def simplefilterextension(v):
    return v * 2

Documentation: local extension

Using a local extension like: - reference extension ```json { "project_slug": "Foobar", "year": "{% now 'utc', '%Y' %}", "_extensions": ["local_extensions.simplefilterextension"] } ``` - Python code example ```python from cookiecutter.utils import simple_filter @simple_filter def simplefilterextension(v): return v * 2 ``` Documentation: [local extension](https://cookiecutter.readthedocs.io/en/stable/advanced/local_extensions.html)
tom added spent time 2024-06-24 16:06:43 +02:00
1 hour
tom added reference feat/issue02-custom-filters 2024-06-24 16:06:48 +02:00
tom closed this issue 2024-06-24 16:06:54 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Total time spent: 1 hour
tom
1 hour
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Templates/cookiecutter-avdlab-project#2
No description provided.