Files
openstack-ansible-openstack…/tasks/openstack_hosts_systemd.yml
Dmitriy Rabotyagov 33bbb8d247 Make role compatible with ansible-core>=2.19
Change-Id: I554ec10b68c222cd736030dd36af78c8884c493a
Signed-off-by: Dmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
2026-01-30 15:29:08 +01:00

68 lines
2.2 KiB
YAML

---
# Copyright 2022, Cleura AB.
#
# 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: Run the systemd-networkd role
ansible.builtin.include_role:
name: systemd_networkd
vars:
systemd_networkd_prefix: "{{ openstack_hosts_systemd_networkd_prefix }}"
systemd_run_networkd: true
systemd_netdevs: "{{ openstack_hosts_systemd_networkd_devices }}"
systemd_networks: "{{ openstack_hosts_systemd_networkd_networks }}"
when:
- openstack_hosts_systemd_networkd_devices | length > 0
- openstack_hosts_systemd_networkd_networks | length > 0
- is_metal | bool
- name: Run the systemd-service role
ansible.builtin.include_role:
name: systemd_service
vars:
systemd_slice_name: "{{ openstack_hosts_systemd_slice }}"
systemd_services: "{{ openstack_hosts_systemd_services }}"
when:
- openstack_hosts_systemd_services | length > 0
- name: Run the systemd mount role
ansible.builtin.include_role:
name: systemd_mount
vars:
systemd_mounts: "{{ openstack_hosts_systemd_mounts }}"
when:
- openstack_hosts_systemd_mounts | length > 0
- name: Configure systemd-journald
when: openstack_hosts_journald_config | length > 0
block:
- name: Create /etc/systemd/journald.conf.d directory
ansible.builtin.file:
path: /etc/systemd/journald.conf.d
state: directory
owner: root
group: systemd-journal
mode: "0755"
- name: Define journald configuration
ansible.builtin.copy:
content: |-
[Journal]
{% for key, value in openstack_hosts_journald_config.items() %}
{{ key }}={{ value }}
{% endfor %}
dest: /etc/systemd/journald.conf.d/99-osa-journal.conf
mode: "0644"
notify:
- Restart systemd-journald