Rename include_dhcp_server -> enable_dhcp for consistency

Change-Id: Iff141df7adbe69775ce264d591be0466bd4a7e3b
This commit is contained in:
Dmitry Tantsur 2022-09-16 12:33:06 +02:00
parent 07d76c39d4
commit 059bd92b24
7 changed files with 23 additions and 18 deletions

View File

@ -187,7 +187,7 @@ def cmd_install(args):
developer_mode=args.develop,
enable_prometheus_exporter=args.enable_prometheus_exporter,
default_boot_mode=args.boot_mode or 'uefi',
include_dhcp_server=not args.disable_dhcp,
enable_dhcp=not args.disable_dhcp,
extra_vars=args.extra_vars,
params_output_file=args.output,
**kwargs)

View File

@ -42,7 +42,7 @@ dnsmasq_
when booting nodes over the network. It can also be used to provide DHCP
to deployed nodes.
Dnsmasq can be disabled by setting ``include_dhcp_server=false``
Dnsmasq can be disabled by setting ``enable_dhcp=false``
or passing ``--disable-dhcp`` to ``bifrost-cli``.
The following components can be enabled if needed:

View File

@ -67,7 +67,7 @@ The IP address and network interface information which will be used by bare
metal machines to connect to the conductor and the internal HTTP server,
and for cross-service interactions.
include_dhcp_server: false
enable_dhcp: false
If you chose to utilize the dhcp server, You may wish to set default ranges:

View File

@ -117,9 +117,9 @@ update_ipa: "{{ update_repos }}"
ipa_add_ssh_key: false
cirros_deploy_image_upstream_url: https://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img
# By default bifrost will deploy dnsmasq to utilize as an integrated DHCP
# server. If you already have a DHCP server, you can pass --disable-dhcp
# to the bifrost-cli install command to disable it.
include_dhcp_server: true
# server. If you already have a DHCP server or do not need DHCP/TFTP at all,
# you can pass --disable-dhcp to the bifrost-cli install command to disable it.
enable_dhcp: "{{ include_dhcp_server | default(true) }}"
# *_git_url can be overridden by local clones for offline installs
dib_git_url: https://opendev.org/openstack/diskimage-builder
ironicclient_git_url: https://opendev.org/openstack/python-ironicclient

View File

@ -309,14 +309,14 @@
set_fact:
itf_infos: "{{ internal_interface }}"
dhcp_netaddr: "{{ dhcp_pool_start }}/{{ dhcp_static_mask }}"
when: include_dhcp_server | bool
when: enable_dhcp | bool
- name: "Compute interface and DHCP network informations"
set_fact:
itf_netaddr1: "{{ itf_infos['address'] }}/{{ itf_infos['netmask'] }}"
itf_netaddr2: "{{ itf_infos['network'] }}/{{ itf_infos['netmask'] }}"
itf_broadcast: "{{ itf_infos['broadcast'] }}/{{ itf_infos['netmask'] }}"
dhcp_netaddr: "{{ dhcp_netaddr | ipaddr('network') }}/{{ dhcp_static_mask }}"
when: include_dhcp_server | bool
when: enable_dhcp | bool
- name: "Validate interface network addresses"
fail:
msg: >
@ -324,7 +324,7 @@
{{ itf_netaddr1 | ipaddr('network') }}/{{ itf_netaddr1 | ipaddr('prefix') }}
vs {{ itf_netaddr2 }}/{{ itf_netaddr2 | ipaddr('prefix') }}
when:
- include_dhcp_server | bool
- enable_dhcp | bool
- itf_netaddr1 | ipaddr('network') != itf_netaddr2 | ipaddr('network')
- name: "Validate interface broadcast addresses"
fail:
@ -333,7 +333,7 @@
{{ itf_netaddr1 | ipaddr('broadcast') }}/{{ itf_netaddr1 | ipaddr('prefix') }}
vs {{ itf_broadcast | ipaddr('broadcast') }}/{{ itf_broadcast | ipaddr('prefix') }}
when:
- include_dhcp_server | bool
- enable_dhcp | bool
- itf_netaddr1 | ipaddr('broadcast') != itf_broadcast | ipaddr('broadcast')
- name: "Validate DHCP and interface addresses"
debug:
@ -343,7 +343,7 @@
{{ dhcp_netaddr | ipaddr('network') }}/{{ dhcp_netaddr | ipaddr('prefix') }}
overriding DHCP with interface settings"
when:
- include_dhcp_server | bool
- enable_dhcp | bool
- itf_netaddr2 | ipaddr('network') != dhcp_netaddr | ipaddr('network')
- name: "Computing new DHCP informations"
set_fact:
@ -351,7 +351,7 @@
dhcp_end_ip: "{{ dhcp_pool_end.split('.')[-1] }}"
dhcp_netaddr: "{{ itf_netaddr1 | ipaddr('network') }}"
when:
- include_dhcp_server | bool
- enable_dhcp | bool
- itf_netaddr2 | ipaddr('network') != dhcp_netaddr | ipaddr('network')
# Note(olivierbourdon38): we could do much more complex network
# computation to derive exact (or way closer to exact) range for
@ -361,21 +361,21 @@
dhcp_pool_start: "{{ '.'.join(dhcp_netaddr.split('.')[0:-1]) }}.{{ dhcp_start_ip }}"
dhcp_pool_end: "{{ '.'.join(dhcp_netaddr.split('.')[0:-1]) }}.{{ dhcp_end_ip }}"
when:
- include_dhcp_server | bool
- enable_dhcp | bool
- itf_netaddr2 | ipaddr('network') != dhcp_netaddr | ipaddr('network')
- name: "Deploy dnsmasq configuration file"
template: src=dnsmasq.conf.j2 dest=/etc/dnsmasq.conf
when: include_dhcp_server | bool
when: enable_dhcp | bool
# NOTE(Shrews) When testing, we want to use our custom dnsmasq.conf file,
# not the one supplied by libvirt.
- name: "Look for libvirt dnsmasq config"
stat: path=/etc/dnsmasq.d/libvirt-bin
register: test_libvirt_dnsmasq
when: include_dhcp_server | bool
when: enable_dhcp | bool
- name: "Disable libvirt dnsmasq config"
command: mv /etc/dnsmasq.d/libvirt-bin /etc/dnsmasq.d/libvirt-bin~
when:
- include_dhcp_server | bool
- enable_dhcp | bool
- test_libvirt_dnsmasq.stat.exists
- testing | bool
- name: "Download Ironic Python Agent kernel & image"

View File

@ -67,11 +67,11 @@
service: name={{ item }} state=restarted enabled=yes
loop:
- dnsmasq
when: include_dhcp_server | bool
when: enable_dhcp | bool
- name: "Send dnsmasq a force-reload signal"
service: name=dnsmasq state=restarted
when: include_dhcp_server | bool
when: enable_dhcp | bool
- name: "Start nginx"
import_role:

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
The variable ``include_dhcp_server`` has been removed to ``enable_dhcp``
for consistency with other variables.