https://github.com/stefanhoelzl/ansible-bamboo-agent-collection
Ansible collection for bamboo remote agent configuration using the REST API.
https://github.com/stefanhoelzl/ansible-bamboo-agent-collection
ansible ansible-galaxy ansible-modules bamboo bamboo-agent ci remote
Last synced: 19 days ago
JSON representation
Ansible collection for bamboo remote agent configuration using the REST API.
- Host: GitHub
- URL: https://github.com/stefanhoelzl/ansible-bamboo-agent-collection
- Owner: stefanhoelzl
- License: gpl-3.0
- Created: 2020-03-08T00:03:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T23:35:54.000Z (almost 3 years ago)
- Last Synced: 2025-01-28T19:47:12.653Z (9 months ago)
- Topics: ansible, ansible-galaxy, ansible-modules, bamboo, bamboo-agent, ci, remote
- Language: Python
- Homepage: https://galaxy.ansible.com/stefanhoelzl/bamboo_agent
- Size: 338 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ansible collection for bamboo agent configuration

Ansible collection for bamboo remote agent configuration
using the [REST API](https://docs.atlassian.com/atlassian-bamboo/REST/6.9.2).
## Features
* [agent authentication](https://confluence.atlassian.com/bamboo/agent*authentication-289277196.html)
* [enable/disable an agent](https://confluence.atlassian.com/bamboo/disabling-or-deleting-an-agent-289277174.html)
* delete agent from Bamboo Server
* update agent name (as shown in Bamboo UI)
* [dedicating an agent](https://confluence.atlassian.com/bamboo/dedicating-an-agent-629015108.html)
* wait until agent is not busy
* [check mode](https://docs.ansible.com/ansible/latest/user_guide/playbooks_checkmode.html) support
* [diff](https://docs.ansible.com/ansible/latest/user_guide/playbooks_checkmode.html#showing-differences-with-diff) support
* only python>=3.5 on agent required
## Usage
install collection
```bash
$ ansible-galaxy collection install stefanhoelzl.bamboo_agent
```
adding a task to your playbook
```yaml
- name: configure bamboo remote agent
stefanhoelzl.bamboo_agent.configuration:
host: "https://atlassian.my-domain.com/bamboo/"
home: "/home/bamboo/bamboo-agent-home"
name: bamboo-agent-name
enabled: false
assignments:
- type: project
key: PR
credentials:
user: "admin"
password: "{{ bamboo_password }}"
```
optinally the collection can be installed in a custom path
```bash
$ ansible-galaxy collection install stefanhoelzl.bamboo_agent -p
```
then `ansible.cfg` has to be edited too
```
[defaults]
collections_paths =
```
for more informations on how to install ansible collections see the [documentation](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html#installing-collections-with-ansible-galaxy).
## Development
### Dependencies
The only required dependencies are `ansible` and `black` (enforces code formatting policy).
Optional can `docker-compose` be used to run the acceptance test suite.
A `Dockerfile` which specifies a development image is located in `.devcontainer`.
This can be used as a standalone container or with the [VS Code Remote Extension](https://code.visualstudio.com/docs/remote/remote-overview).
### Build
checkout the repository
```bash
$ git clone git clone https://github.com/stefanhoelzl/ansible-bamboo-agent-collection.git
$ cd ansible-bamboo-agent-collection
```
build the collection
```bash
$ ./build.sh
```
The built collection can be found in the `release` directory.
install the collection
```bash
$ ansible-galaxy collection install release/stefanhoelzl.bamboo_agent-${VERSION}.tar.gz
```
### Testing
Integration and unit tests can be run with
```bash
$ python tests
```
In `tests/env` is a environment with a real Bamboo server for acceptance testing defined,
using [docker compose](https://docs.docker.com/compose/).
It starts a Bamboo server, and Bamboo remote agent and an ansible control node in separate docker containers,
runs a playbook on the ansible control node to configure the remote agent and checks if it was successfully.
The acceptance test suite can be run with
```bash
$ tests/acceptance_tests.sh
```