chore: first commit

This commit is contained in:
Clément Désiles
2025-07-25 20:23:54 +02:00
parent 5c4016357f
commit c612cc7839
88 changed files with 3255 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
# Ansible Gists
Scripts that took time to write and that I'm not sure I will use again.
## Convert netmask to CIDR notation
```yml
- name: Convert netmask to CIDR notation
set_fact:
cidr_notation: >-
{{
(interface.netmask.split('.') |
map('int') |
map('string') |
map('regex_replace', '^(.*)$', '\\1|int|format("08b")') |
map('regex_replace', '^(.*)$', '{{\\1}}') |
join('') |
regex_replace('0+$', '') |
length)
}}
when: interface.netmask is defined and network_file.stat.exists != true
```