Files
openstack-ansible/tests/roles/bootstrap-host/tasks/prepare_networking.yml
Dmitriy Rabotyagov 31f12f54ea Offload network provisionment for AIO to openstack_hosts
For couple of cycles we include our systemd-related roles in
openstack_hosts role, with purpose of operators being able to
configure their nodes before any actuall service or infra role will
kick in.

This should also provide ability to configure networking for LXC and
setup overall.

So with moving systemd role includes during AIO setup to
variables which leverage openstack_hosts behavior we achieve
multiple goals at once:
- Reduce amount of intersecting logic in AIO bootstrap
- Add testing for openstack_hosts section and ensure it's functional
- Improve transparency for deployers and ability to see and change
network configuration, as it will be templated as variables file
instead of be directly applied.

As a consequence, we need to access host by it's already established
IP address, rather then one defined by us.
However, we already require having `bootstrap_host_public_address`
and rely on it heavily, so it should not bring much regressions
with the approach.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-haproxy_server/+/953670
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/954316
Change-Id: Ib688a5a758ec5ebbd0ebafdcaf2b27aeecdd9aba
Signed-off-by: Dmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
2025-08-18 14:37:30 +02:00

40 lines
1.1 KiB
YAML

---
# Copyright 2015, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Check if firewalld is installed
ansible.builtin.command: rpm -q firewalld # noqa: command-instead-of-module
register: firewalld_check
changed_when: false
failed_when: firewalld_check.rc > 1
- name: Disable firewalld
become: true
ansible.builtin.service:
name: "{{ item }}"
enabled: false
state: stopped
with_items:
- firewalld
when:
- firewalld_check.rc == 0
- name: Disable NetworkManager
become: true
ansible.builtin.service:
name: NetworkManager
state: stopped
enabled: false
masked: true