Execution
Date 08 Dec 2025 13:27:39 +0000
Duration 00:05:33.94
Controller aio1.openstack.local
User root
Versions
Ansible 2.18.6
ara 1.7.4 / 1.7.4
Python 3.12.3
Summary
2 Hosts
316 Tasks
313 Results
18 Plays
136 Files
0 Records

File: /home/zuul/src/opendev.org/openstack/openstack-ansible-openstack_hosts/tasks/openstack_hosts_systemd.yml

---
# 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
    - openstack_hosts_systemd_networkd_networks
    - is_metal

- 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

- 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

- name: Configure systemd-journald
  when: openstack_hosts_journald_config
  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