Compare commits
11 Commits
99fd6a58b8
...
cb98f53712
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb98f53712 | ||
|
|
2888fa60bb | ||
|
|
d83f3c92c6 | ||
|
|
d4424bfd7e | ||
|
|
cf58f71755 | ||
|
|
b907e14bd1 | ||
|
|
b01e6b35b7 | ||
|
|
91300e39bb | ||
|
|
cfd5215550 | ||
|
|
b88b49ffb8 | ||
|
|
c9401c88b7 |
BIN
ansible-runner-service-1.0.7.tar.gz
Normal file
BIN
ansible-runner-service-1.0.7.tar.gz
Normal file
Binary file not shown.
76
ansible-runner-service.spec
Normal file
76
ansible-runner-service.spec
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
Name: ansible-runner-service
|
||||||
|
Version: 1.0.7
|
||||||
|
Release: 4
|
||||||
|
License: ASL 2.0
|
||||||
|
Summary: RESTful API for ansible/ansible_runner execution
|
||||||
|
Source0: https://github.com/ansible/%{name}/archive/%{name}-%{version}.tar.gz
|
||||||
|
Patch0: ovirt_log.patch
|
||||||
|
Patch1: wsgi.patch
|
||||||
|
Patch2: be-compatible-with-pyyaml-6.x.patch
|
||||||
|
BuildArch: noarch
|
||||||
|
BuildRequires: systemd python3-devel python3-setuptools
|
||||||
|
Requires: ansible
|
||||||
|
Requires: logrotate
|
||||||
|
Requires: openssl
|
||||||
|
Requires: openssh
|
||||||
|
Requires: openssh-clients
|
||||||
|
Requires: policycoreutils-python-utils
|
||||||
|
Requires: python3
|
||||||
|
Requires: python3-ansible-runner
|
||||||
|
Requires: python3-pyOpenSSL
|
||||||
|
Requires: python3-netaddr
|
||||||
|
Requires: python3-notario
|
||||||
|
Requires: python3-flask
|
||||||
|
Requires: python3-flask-restful
|
||||||
|
Requires: python3-psutil
|
||||||
|
|
||||||
|
%global _description %{expand:
|
||||||
|
This package provides the Ansible Runner Service source files. Ansible runner service exposes a REST API interface on top of the functionality provided by ansible and ansible_runner.
|
||||||
|
The Ansible Runner Service provided in this packages is intended to be used as uwgsi app exposed by Nginx in a Container.
|
||||||
|
Dependencies, and configuration tasks must be performed in the container.
|
||||||
|
Ansible Runner Service listens on https://localhost:5001 by default for playbook or ansible inventory requests. For developers interested in using the API, all the available endpoints are documented at https://localhost:5001/api.
|
||||||
|
In addition to the API endpoints, the daemon also provides a /metrics endpoint for prometheus integration. A sample Grafana dashboard is provided within /usr/share/doc/ansible-runner-service}
|
||||||
|
%description %_description
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -n %{name}-%{version} -p1
|
||||||
|
|
||||||
|
%build
|
||||||
|
%py3_build
|
||||||
|
|
||||||
|
%install
|
||||||
|
%py3_install
|
||||||
|
mkdir -p %{buildroot}%{_sysconfdir}/ansible-runner-service
|
||||||
|
install -m 644 ./config.yaml %{buildroot}%{_sysconfdir}/ansible-runner-service
|
||||||
|
install -m 644 ./logging.yaml %{buildroot}%{_sysconfdir}/ansible-runner-service
|
||||||
|
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
|
||||||
|
install -m 644 ./misc/packaging/logrotate/ansible-runner-service %{buildroot}%{_sysconfdir}/logrotate.d/ansible-runner-service
|
||||||
|
install -m 644 ./ansible_runner_service.py %{buildroot}%{python3_sitelib}/runner_service
|
||||||
|
mkdir -p %{buildroot}%{_var}/www/runnner
|
||||||
|
install -m 644 ./wsgi.py %{buildroot}%{_var}/www/runnner/runner.wsgi
|
||||||
|
|
||||||
|
%post
|
||||||
|
semanage fcontext -a -t httpd_log_t -s system_u /var/log/ovirt-engine/ansible-runner-service.log 2> /dev/null || semanage fcontext -m -t httpd_log_t -s system_u /var/log/ovirt-engine/ansible-runner-service.log || true
|
||||||
|
[[ -f /var/log/ovirt-engine/ansible-runner-service.log ]] && restorecon -rF /var/log/ovirt-engine/ansible-runner-service.log || true
|
||||||
|
|
||||||
|
%files -n ansible-runner-service
|
||||||
|
%{_bindir}/ansible_runner_service
|
||||||
|
%{python3_sitelib}/*
|
||||||
|
%{_sysconfdir}/logrotate.d/ansible-runner-service
|
||||||
|
%config(noreplace) %{_sysconfdir}/ansible-runner-service/*
|
||||||
|
%{_var}/www/runnner/runner.wsgi
|
||||||
|
%license LICENSE.md
|
||||||
|
%doc README.md
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Tue Mar 14 2023 wangdi <wangdi@kylinos.cn> - 1.0.7-4
|
||||||
|
- Be compatible with pyyaml 6.x
|
||||||
|
|
||||||
|
* Tue Mar 14 2023 wangdi <wangdi@kylinos.cn> - 1.0.7-3
|
||||||
|
- Add missing requires
|
||||||
|
|
||||||
|
* Tue Aug 23 2022 jiangxinyu <jiangxinyu@kylinos.cn> - 1.0.7-2
|
||||||
|
- Add requires to provide the semanage command
|
||||||
|
|
||||||
|
* Wed Aug 25 2021 huanghaitao <huanghaitao8@huawei.com> - 1.0.7-1
|
||||||
|
- package init
|
||||||
4
ansible-runner-service.yaml
Normal file
4
ansible-runner-service.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
version_control: github
|
||||||
|
src_repo: ansible/ansible-runner-service
|
||||||
|
tag_prefix: ^
|
||||||
|
separator: "."
|
||||||
25
be-compatible-with-pyyaml-6.x.patch
Normal file
25
be-compatible-with-pyyaml-6.x.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From cfb3d7cdb6936afe61018fa2062ae05dcf5b0b2d Mon Sep 17 00:00:00 2001
|
||||||
|
From: wangdi <wangdi@kylinos.cn>
|
||||||
|
Date: Tue, 14 Mar 2023 09:22:33 +0800
|
||||||
|
Subject: [PATCH] be compatible with pyyaml 6.x
|
||||||
|
|
||||||
|
---
|
||||||
|
runner_service/configuration.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/runner_service/configuration.py b/runner_service/configuration.py
|
||||||
|
index d7a5c17..71a1307 100644
|
||||||
|
--- a/runner_service/configuration.py
|
||||||
|
+++ b/runner_service/configuration.py
|
||||||
|
@@ -106,7 +106,7 @@ class Config(object):
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open(self.config_file, "r") as _cfg:
|
||||||
|
- local_config = yaml.load(_cfg.read())
|
||||||
|
+ local_config = yaml.safe_load(_cfg.read())
|
||||||
|
except yaml.YAMLError as exc:
|
||||||
|
logger.critical("ERROR: YAML error in configuration "
|
||||||
|
"file: {}".format(exc))
|
||||||
|
--
|
||||||
|
2.39.1
|
||||||
|
|
||||||
29
ovirt_log.patch
Normal file
29
ovirt_log.patch
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
diff --git a/logging.yaml b/logging.yaml
|
||||||
|
index 8357727..16a0c1c 100644
|
||||||
|
--- a/logging.yaml
|
||||||
|
+++ b/logging.yaml
|
||||||
|
@@ -7,21 +7,13 @@ formatters:
|
||||||
|
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- console:
|
||||||
|
- class: logging.StreamHandler
|
||||||
|
- level: DEBUG
|
||||||
|
- formatter: simple
|
||||||
|
- stream: ext://sys.stdout
|
||||||
|
-
|
||||||
|
file_handler:
|
||||||
|
- class: logging.handlers.RotatingFileHandler
|
||||||
|
+ class: logging.handlers.WatchedFileHandler
|
||||||
|
level: DEBUG
|
||||||
|
formatter: simple
|
||||||
|
- filename: ansible-runner-service.log
|
||||||
|
+ filename: /var/log/ovirt-engine/ansible-runner-service.log
|
||||||
|
- maxBytes: 10485760 # 10MB
|
||||||
|
- backupCount: 20
|
||||||
|
encoding: utf8
|
||||||
|
|
||||||
|
root:
|
||||||
|
level: DEBUG
|
||||||
|
- handlers: [console, file_handler]
|
||||||
|
+ handlers: [file_handler]
|
||||||
23
wsgi.patch
Normal file
23
wsgi.patch
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
diff --git a/wsgi.py b/wsgi.py
|
||||||
|
index d66f9c5..93fc875 100644
|
||||||
|
--- a/wsgi.py
|
||||||
|
+++ b/wsgi.py
|
||||||
|
@@ -1,6 +1,8 @@
|
||||||
|
+#!/usr/bin/python
|
||||||
|
+
|
||||||
|
import runner_service.configuration as configuration
|
||||||
|
from runner_service.app import create_app
|
||||||
|
-from ansible_runner_service import setup_common_environment, remove_artifacts_init
|
||||||
|
+from runner_service.ansible_runner_service import setup_logging, remove_artifacts_init
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
@@ -14,7 +16,7 @@ It exposes the WSGI callable as a module-level variable named ``application``.
|
||||||
|
configuration.init(mode='prod')
|
||||||
|
|
||||||
|
# Setup log and ssh and other things present in all the environments
|
||||||
|
-setup_common_environment()
|
||||||
|
+setup_logging()
|
||||||
|
|
||||||
|
# Setup remove of artifacts
|
||||||
|
remove_artifacts_init()
|
||||||
Loading…
x
Reference in New Issue
Block a user