Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

DCI Ansible modules and callback

License

Apache-2.0, GPL-3.0 licenses found

Licenses found

Apache-2.0
LICENSE
GPL-3.0
COPYING
NotificationsYou must be signed in to change notification settings

redhat-cip/dci-ansible

Repository files navigation

A set ofAnsible modules and callbacks to ease the interaction with theDistributed-CI platform.

Get Started

Installation

There are two ways to installdci-ansible, either via rpm packages or directly via Github source code.

Unless you are looking to contribute to this project, we recommend you use the rpm packages.

Packages

Officially supported platforms:

  • CentOS (latest version)
  • RHEL (latest version)
  • Fedora (latest version)

If you're looking to install those modules on a different Operating System, please install it fromsource

First, you need to install the official Distributed-CI package repository

#dnf install https://packages.distributed-ci.io/dci-release.el8.noarch.rpm

Then, install the package

#dnf install dci-ansible

Sources

Define a folder where you want to extract the code and clone the repository.

#cd /usr/share/dci&& git clone https://github.com/redhat-cip/dci-ansible.git

How to use it

Authentication

The modules provided by this project cover all the endpoints Distributed-CI offers.

This means that this project allows one to interact with Distributed-CI for various use-cases:

  • To act as an agent: Scheduling jobs, uploading logs, and test results.
  • To act as a feeder: Creating Topics, Components and uploading Files.
  • To complete administrative tasks: Creating Teams, Users, RemoteCIs.
  • And more...

For any of the modules made available to work with the Distributed-CI API, one needs to authenticate itself first.

Each module relies on three environment variables to authenticate the author of the query:

  • DCI_CLIENT_ID: The ID of the resource that wishes to authenticate (RemoteCI, User, Feeder)
  • DCI_API_SECRET: The API Secret of the resource that wishes to authenticate
  • DCI_CS_URL: The API address (default tohttps://api.distributed-ci.io)

The recommended way is to retrieve thedcirc.sh file directly fromhttps://www.distributed-ci.io or create it yourself in the same folder as your playbook:

$cat> dcirc.sh<<EOFexport DCI_CLIENT_ID=<resource_id>export DCI_API_SECRET=<resource_api_secret>export DCI_CS_URL=https://api.distributed-ci.ioEOF

And then run the playbook the following way:

$source dcirc.sh&& ansible-playbook playbook.yml

By now mydci-test/ folder looks like this:

$ls -l dci-test/total 837-rw-rw-r--. 1 jdoe jdoe 614 Oct 19 14:51 dcirc.sh-rw-rw-r--. 1 jdoe jdoe 223 Oct 19 14:51 playbook.yml

File organization

Since the modules of dci-ansible are not part of Ansible, one needs to tell Ansible where to look for the extra modules and callbacks this project is providing.This is done via theAnsible configuration file.

The Distributed-CI team recommends that you place anansible.cfg file in the same folder as your playbook with the following content:

[defaults]library            = /usr/share/dci/modules/module_utils       = /usr/share/dci/module_utils/callback_whitelist = dci,dcijunitcallback_plugins   = /usr/share/dci/callback/

Note: If you installed the modules from source, please update the paths accordingly.

By now, mydci-test/ folder looks like this:

$ls -l dci-test/total 1014-rw-rw-r--. 1 jdoe jdoe 177 Oct 19 14:51 ansible.cfg-rw-rw-r--. 1 jdoe jdoe 614 Oct 19 14:51 dcirc.sh-rw-rw-r--. 1 jdoe jdoe 223 Oct 19 14:51 playbook.yml

Modules

The following modules are available to use with Distributed-CI in your playbooks:

Samples

The following examples will highlight how to interact with a resource. The remoteci resource will be taken as an example. The same pattern applies to all Distributed-CI resources,

  • Create a RemoteCI
----hosts:localhosttasks:    -name:Create a RemoteCIdci_remoteci:name:MyRemoteCI
  • List all RemoteCI
----hosts:localhosttasks:    -name:List all RemoteCIsdci_remoteci:
  • Update a RemoteCI
----hosts:localhosttasks:    -name:Update a RemoteCIsdci_remoteci:id:<remoteciid>name:NewName
  • Delete a RemoteCI
----hosts:localhosttasks:    -name:Delete a RemoteCIsdci_remoteci:id:<remoteciid>state:absent

Examples of real-life scenarios are available in thesamples/ directory.

Contributing

We'd love to get contributions from you!

If you'd like to report a bug or suggest new ideas, you can do ithere.

If you'd like to contribute code back to dci-ansible, our code is hosted onSoftware Factory and then mirrored on GitHub.Software Factory is Gerrit-based. Please contact us if you feel uncomfortable with the workflow or have any questions.

Running tests

Before running tests, you must familiarize yourself with thedci-dev-env project.

dci-dev-env is a Docker-based environment that will deploy a Distributed-CI Control Server API, the UI, and more.Once deployed locally, you can run the test suite against this deployment.

To run the test, ensure the API is running by runningdocker ps and then simply run./run_tests.sh in thetests/ folder

Generating modules doc

If you change or add any documentation for modules, use this command to generate the Markdown documents out of theDOCUMENTATION andEXAMPLES variables from the modules:

$make clean doc

License

Apache License, Version 2.0 (seeLICENSE file)

Contact

Email: Distributed-CI Teamdistributed-ci@redhat.com

About

DCI Ansible modules and callback

Resources

License

Apache-2.0, GPL-3.0 licenses found

Licenses found

Apache-2.0
LICENSE
GPL-3.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp