Skip to content

stefanhoelzl/ansible-bamboo-agent-collection

Repository files navigation

Ansible collection for bamboo agent configuration

GitHub Workflow Status

Ansible collection for bamboo remote agent configuration using the REST API.

Features

Usage

install collection

$ ansible-galaxy collection install stefanhoelzl.bamboo_agent

adding a task to your playbook

- 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

$ ansible-galaxy collection install stefanhoelzl.bamboo_agent -p <path>

then ansible.cfg has to be edited too

[defaults]
collections_paths = <path>

for more informations on how to install ansible collections see the documentation.

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.

Build

checkout the repository

$ git clone git clone https://github.com/stefanhoelzl/ansible-bamboo-agent-collection.git
$ cd ansible-bamboo-agent-collection

build the collection

$ ./build.sh

The built collection can be found in the release directory.

install the collection

$ ansible-galaxy collection install release/stefanhoelzl.bamboo_agent-${VERSION}.tar.gz

Testing

Integration and unit tests can be run with

$ python tests

In tests/env is a environment with a real Bamboo server for acceptance testing defined, using docker 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

$ tests/acceptance_tests.sh