Skip to content

Commit

Permalink
add cobbler_dnsmasq_options (#26)
Browse files Browse the repository at this point in the history
* add cobbler_dnsmasq_options

add var: 'cobbler_dnsmasq_options' to insert options to dnsmasq.template

* add space to comments in defaults/main.yml
  • Loading branch information
jsl6ul authored Apr 15, 2024
1 parent 7ca2f36 commit 0db92d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ cobbler_systems: []
# cobbler_settings, otherwise Cobbler will not configure the services.
cobbler_dnsmasq_module: false

# cobbler_dnsmasq_options, a 'BlockInFile' inserted 'As is' in /etc/cobbler/dnsmasq.template

Check failure on line 91 in defaults/main.yml

View workflow job for this annotation

GitHub Actions / Run static code analysis tools

yaml[trailing-spaces]

Trailing spaces
# cobbler_dnsmasq_options: |
# interface=eth0
# dhcp-range=192.168.0.101,192.168.0.150
# dhcp-option=3,192.168.0.1

# DHCP range
# String compatible with Dnsmasq's dhcp-range parameter.
# While Dnsmasq allows to repeat the 'dhcp-range' parameter, this role only
Expand Down
9 changes: 9 additions & 0 deletions tasks/modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,12 @@
mode: '0600'
loop: ['dns', 'dhcp']
notify: Restart cobbler

- name: Add dnsmasq options to dnsmasq.template
ansible.builtin.blockinfile:
path: /etc/cobbler/dnsmasq.template
block: "{{ cobbler_dnsmasq_options }}"
insertbefore: "^read-ethers"
marker: "### {mark} Ansible Managed Block - cobbler_dnsmasq_options ###"
when: cobbler_dnsmasq_options is defined
notify: Restart cobbler

0 comments on commit 0db92d6

Please sign in to comment.