Add podman_socket role
This patch adds a role for creating podman unix socket for TripleO purposes.
It will be used during collectd deployments since collectd-sensubility
requires accessing podman via the socket.
Fixes molecule tests for tripleo_podman role.
Change-Id: I7538def60e4fd3a7187ede0e1f5ada1b0c460f65
(cherry picked from commit 4fd0e5a9ae
)
This commit is contained in:
parent
82b87c1a6a
commit
64ea7d8b33
|
@ -87,3 +87,7 @@ tripleo_container_default_infra_image: "registry.access.redhat.com/ubi8/pause"
|
|||
# additional ordering dependencies for the systemd
|
||||
# scopes associated to podman containers.
|
||||
tripleo_podman_systemd_drop_in_dependencies: true
|
||||
|
||||
tripleo_podman_service_unit_name: "tripleo_podman.service"
|
||||
tripleo_podman_service_unit_description: "Podman API service for TripleO purposes"
|
||||
tripleo_podman_socket_path: /var/lib/tripleo-podman/podman.sock
|
||||
|
|
|
@ -33,6 +33,7 @@ galaxy_info:
|
|||
versions:
|
||||
- 7
|
||||
- 8
|
||||
- 9
|
||||
|
||||
galaxy_tags:
|
||||
- tripleo
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
- role: test_deps
|
||||
test_deps_extra_packages:
|
||||
- runc
|
||||
- containernetworking-plugins
|
||||
- role: env_data
|
||||
post_tasks:
|
||||
- name: pull an image
|
||||
|
|
|
@ -21,4 +21,7 @@
|
|||
gather_facts: true
|
||||
roles:
|
||||
- role: test_deps
|
||||
test_deps_extra_packages:
|
||||
- runc
|
||||
- containernetworking-plugins
|
||||
- role: env_data
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
|
||||
roles:
|
||||
- role: test_deps
|
||||
test_deps_extra_packages:
|
||||
- runc
|
||||
- containernetworking-plugins
|
||||
- role: env_data
|
||||
|
||||
tasks:
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
|
||||
# Note: Previous versions of TripleO used log file with podman exec specific data
|
||||
# to provide health check execution results to sensubility. This serves for
|
||||
# cleanup of unneeded rsyslog configuration since sensubility is fetching
|
||||
# data straight from podman socket
|
||||
|
||||
- name: remove unneeded podman-related rsyslog configuration
|
||||
ansible.builtin.file:
|
||||
path: /etc/rsyslog.d/openstack-healthcheck.conf
|
||||
state: absent
|
||||
ignore_errors: yes
|
||||
register: rmcfg
|
||||
- when: rmcfg is changed
|
||||
service:
|
||||
name: rsyslog
|
||||
state: restarted
|
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
# Copyright 2022 Red Hat, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# 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: Ensure podman socket directory exists
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{ tripleo_podman_socket_path | dirname }}"
|
||||
state: directory
|
||||
|
||||
- name: Create required systemd unit file for podman service
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: podman.service.j2
|
||||
dest: "/etc/systemd/system/{{ tripleo_podman_service_unit_name }}"
|
||||
mode: 0644
|
||||
|
||||
- name: Enable podman service unit
|
||||
ansible.builtin.service:
|
||||
name: "{{ tripleo_podman_service_unit_name }}"
|
||||
state: started
|
||||
enabled: true
|
|
@ -0,0 +1,14 @@
|
|||
[Unit]
|
||||
Description={{ tripleo_podman_service_unit_description }}
|
||||
Documentation=man:podman-system-service(1)
|
||||
StartLimitIntervalSec=0
|
||||
|
||||
[Service]
|
||||
Delegate=true
|
||||
Type=exec
|
||||
KillMode=process
|
||||
Environment=LOGGING="--log-level=info"
|
||||
ExecStart=/usr/bin/podman $LOGGING system service --time=0 unix://{{ tripleo_podman_socket_path }}
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
Loading…
Reference in New Issue