
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>
48 lines
1.6 KiB
YAML
48 lines
1.6 KiB
YAML
---
|
|
# Copyright 2018, BBC.
|
|
#
|
|
# 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.
|
|
|
|
# NOTE(noonedeadpunk): We can not offload this to openstack_hosts, as Squid should be already
|
|
# operational for it.
|
|
- name: Prepare Squid interface
|
|
ansible.builtin.include_role:
|
|
name: systemd_networkd
|
|
vars:
|
|
systemd_networkd_prefix: "osa_proxy"
|
|
systemd_networkd_epel_mirror: "{{ (nodepool_vars is defined) | ternary(nodepool_vars.NODEPOOL_EPEL_MIRROR, 'http://download.fedoraproject.org/pub/epel') }}"
|
|
systemd_interface_cleanup: true
|
|
systemd_run_networkd: true
|
|
systemd_netdevs:
|
|
- NetDev:
|
|
Name: dummy-squid
|
|
Kind: dummy
|
|
systemd_networks:
|
|
- interface: "dummy-squid"
|
|
address: "{{ squid_network }}"
|
|
|
|
- name: Install squid packages
|
|
ansible.builtin.package:
|
|
name: squid
|
|
state: present
|
|
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
|
|
notify: Restart squid
|
|
tags:
|
|
- install-packages
|
|
|
|
- name: Install squid config
|
|
ansible.builtin.template:
|
|
src: "squid.conf.j2"
|
|
dest: "/etc/squid/squid.conf"
|
|
mode: "0644"
|