Adds koji_tools role

master 0.1.1
Eugene Zamriy 11 months ago
parent bb441fc253
commit f148f69432
Signed by: ezamriy
GPG Key ID: 7EBF95C7DCFA496C

@ -5,6 +5,14 @@ msvsphere.ci Release Notes
.. contents:: Topics .. contents:: Topics
v0.1.1
======
New Roles
---------
- msvsphere.ci.koji_tools - A role that installs koji-tools.
v0.1.0 v0.1.0
====== ======

@ -4,6 +4,7 @@ The MSVSphere OS CI/CD collection.
## Roles ## Roles
* [koji_tools](roles/koji_tools/README.md)
* [postgresql_server](roles/postgresql_server/README.md) * [postgresql_server](roles/postgresql_server/README.md)
## Documentation ## Documentation

@ -1,5 +1,9 @@
objects: objects:
role: role:
koji_tools:
description: A role that installs koji-tools.
name: koji_tools
version_added: 0.1.1
postgresql_server: postgresql_server:
description: A role that installs and configures a PostgreSQL server description: A role that installs and configures a PostgreSQL server
name: postgresql_server name: postgresql_server
@ -20,4 +24,4 @@ plugins:
strategy: {} strategy: {}
test: {} test: {}
vars: {} vars: {}
version: 0.1.0 version: 0.1.1

@ -11,3 +11,10 @@ releases:
name: postgresql_server name: postgresql_server
namespace: null namespace: null
release_date: '2023-12-12' release_date: '2023-12-12'
0.1.1:
objects:
role:
- description: A role that installs koji-tools.
name: koji_tools
namespace: null
release_date: '2023-12-13'

@ -1,6 +1,6 @@
namespace: msvsphere namespace: msvsphere
name: ci name: ci
version: 0.1.0 version: 0.1.1
readme: README.md readme: README.md
authors: authors:
- Eugene Zamriy <ezamriy@msvsphere-os.ru> - Eugene Zamriy <ezamriy@msvsphere-os.ru>

@ -0,0 +1,11 @@
---
- name: Converge
hosts: all
gather_facts: true
become: true
tasks:
- name: Test koji_tools role
ansible.builtin.include_role:
name: msvsphere.ci.koji_tools
rolespec_validate: true

@ -0,0 +1,9 @@
---
driver:
name: vagrant
platforms:
- name: msvsphere-9
box: msvsphere/9
memory: 1024
cpus: 1

@ -0,0 +1,48 @@
---
- name: Verify
hosts: all
become: true
vars:
repo_path: /usr/local/koji-tools
tasks:
- include_tasks: ../resources/tests/common/tasks/package_installed.yml
vars:
package_name: "{{ item }}"
with_items:
- git
- python3-cryptography
- name: Collect koji-tools repository directory stats
ansible.builtin.stat:
path: "{{ repo_path }}"
register: repo_path_stats
- name: Verify koji-tools repository directory stats
ansible.builtin.assert:
that: |
repo_path_stats.stat.exists and
repo_path_stats.stat.mode == '0755' and
repo_path_stats.stat.pw_name == 'root' and
repo_path_stats.stat.gr_name == 'root'
- name: Get koji-tools git commit hash
ansible.builtin.command: "git -C {{ repo_path }} log --format='%H' -n 1"
register: git_log
- name: Verify koji-tools git commit hash
ansible.builtin.assert:
that: |
git_log.stdout == '2b8a094bb5d3dfbdcb768f9ffc02c1247ae99e38'
fail_msg: koji-tools git commit hash does not match expected 2b8a094bb5d3dfbdcb768f9ffc02c1247ae99e38
success_msg: koji-tools git commit hash matches expected 2b8a094bb5d3dfbdcb768f9ffc02c1247ae99e38
- name: Execute koji-ssl-admin
ansible.builtin.command: "{{ (repo_path, 'src/bin/koji-ssl-admin' ) | path_join }} -h"
register: koji_ssl_admin_status
- name: Check koji-ssl-admin exit code
ansible.builtin.assert:
that: |
koji_ssl_admin_status.rc == 0

@ -0,0 +1,17 @@
# msvsphere.ci.koji_tools
An Ansible role that installs [koji-tools](https://pagure.io/koji-tools).
## Variables
| Variable | Default value | Type | Description | Required |
| -------- | ------------- | ---- |----------- | -------- |
| koji_tools_git_ref | "2b8a094bb5d3dfbdcb768f9ffc02c1247ae99e38" | string | koji-tools git repository reference | no |
## License
MIT.
## Authors
* [Eugene Zamriy](mailto:ezamriy@msvsphere-os.ru)

@ -0,0 +1,2 @@
---
koji_tools_git_ref: '2b8a094bb5d3dfbdcb768f9ffc02c1247ae99e38'

@ -0,0 +1,12 @@
---
argument_specs:
main:
short_description: A role that installs koji-tools.
author: Eugene Zamriy
version_added: '0.1.1'
options:
koji_tools_git_ref:
description: koji-tools git repository reference.
default: '2b8a094bb5d3dfbdcb768f9ffc02c1247ae99e38'
type: 'str'
required: false

@ -0,0 +1,15 @@
---
galaxy_info:
author: Eugene Zamriy
description: An Ansible role that installs koji-tools.
company: Softline PJSC
license: MIT
min_ansible_version: 2.13
platforms:
- name: EL
versions:
- "9"
galaxy_tags:
- koji
dependencies: []

@ -0,0 +1,13 @@
---
- name: Install dependencies
ansible.builtin.dnf:
name:
- git
- python3-cryptography
state: present
- name: Clone koji-tools git repository
ansible.builtin.git:
repo: 'https://pagure.io/koji-tools.git'
dest: /usr/local/koji-tools
version: "{{ koji_tools_git_ref }}"
Loading…
Cancel
Save