Skip to content

Commit

Permalink
Add DNS Search option
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandwich committed Feb 10, 2025
1 parent c8d3de3 commit 122bd5c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Inventory variables are defined for individual hosts or VMs in the inventory fil
| `vm_ballo` (optional) | Ballooning memory size for the VM, used to adjust memory allocation dynamically. | `2048` |
| `vm_cpus` | Number of CPU cores assigned to the virtual machine. | `4` |
| `vm_dns` | DNS server IP address(es) for the virtual machine's network configuration. | `1.0.0.1`, `1.1.1.1` |
| `vm_dns_search` | DNS search zone for the virtual machine's network configuration. | `example.com` |
| `vm_gw` | Default gateway IP address for the virtual machine's network configuration. | `192.168.0.1` |
| `vm_id` | Unique identifier for the virtual machine. | `101` |
| `vm_ip` | IP address assigned to the virtual machine. | `192.168.0.10` |
Expand Down
1 change: 1 addition & 0 deletions inventory_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ all:
vm_nif: vmbr1
vm_gw: 192.168.122.1
vm_dns: 1.1.1.1
vm_dns_search: "example.com"
192.168.122.11:
hostname: database
vm_id: 101
Expand Down
3 changes: 3 additions & 0 deletions roles/configuration/templates/network.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ mac-address={{ net_mac.stdout }}
[ipv4]
address={{ vm_ip }}/{{ vm_nms | default (24) }},{{ vm_gw }}
dns={{ vm_dns }}
{% if vm_dns_search is defined %}
dns-search={{ vm_dns_search }}
{% endif %}
method=manual

[ipv6]
Expand Down

0 comments on commit 122bd5c

Please sign in to comment.