Skip to content

linxsa/ansible-role-rundeck

 
 

Install and configure rundeck on your system.

Travis GitHub Quality Downloads Version
travis github quality downloads Version

This example is taken from molecule/resources/converge.yml and is tested on each push, pull request and release.

---
- name: Converge
  hosts: all
  become: yes
  gather_facts: yes

  roles:
    - role: robertdebock.rundeck

The machine may need to be prepared using molecule/resources/prepare.yml:

---
- name: Prepare
  hosts: all
  gather_facts: no
  become: yes

  roles:
    - role: robertdebock.bootstrap
    - role: robertdebock.java
    - role: robertdebock.common

For verification molecule/resources/verify.yml runs after the role has been applied.

---
- name: Verify
  hosts: all
  become: yes
  gather_facts: yes

  roles:
    - robertdebock.core_dependencies

  tasks:
    - name: check port 4440
      block:
        - name: check port 4440 on {{ ansible_default_ipv4.address }}
          wait_for:
            port: 4440
            timeout: 60
            host: "{{ ansible_default_ipv4.address }}"
      rescue:
        - name: check port 4440 on localhost
          wait_for:
            timeout: 60
            port: 4440

    - name: connect to rundeck
      block:
        - name: connect to http://{{ ansible_default_ipv4.address }}:4440
          uri:
            url: "http://{{ ansible_default_ipv4.address }}:4440/user/login"
            method: GET
      rescue:
        - name: connect to http://locahost:4440
          uri:
            url: "http://localhost:4440/user/login"
            method: GET

Also see a full explanation and example on how to use these roles.

These variables are set in defaults/main.yml:

---
# defaults file for rundeck

# Rundeck version to install
rundeck_version: 3.2.6
rundeck_release_date: 20200427

# Where to install rundeck.
rundeck_rdeckbase: /opt/rundeck

# The Xmx memory size in mb. (Stored in: "{{ rundeck_rdeckbase }}/etc/profile".)
rundeck_xmx: 1024
rundeck_xms: 256
rundeck_maxmetaspacesize: 128

# The URL where Rundeck will be served on:
rundeck_port: 4440
rundeck_address: "{{ ansible_all_ipv4_addresses[0] | default('127.0.0.1') }}"

# You can change the context to for example: "/rundeck". An empty value means
# that no specific context is added.
rundeck_server_web_context: ""

# The `rundeck_url` is a combination of the above values.
rundeck_url: "http://{{ rundeck_address }}:{{ rundeck_port }}{{ rundeck_server_web_context }}"

rundeck_config:
  - parameter: server.address
    value: "{{ rundeck_address }}"
  - parameter: grails.serverURL
    value: "{{ rundeck_url }}"
  - parameter: dataSource.url
    value: "jdbc:h2:file:/opt/rundeck/server/data/grailsdb;MVCC=true"
#   To connect to MySQL, use these settings. (Database has to be prepared.)
#   - parameter: dataSource.url
#     value: "jdbc:mysql://myserver/rundeck?autoReconnect=true&useSSL=false"
#   - parameter: dataSource.username
#     value: rundeck
#   - parameter: dataSource.password
#     value: rundeck
#   - parameter: dataSource.driverClassName
#     value: com.mysql.jdbc.Driver

# The settings for Rundeck. (Stored in: "{{ rundeck_rdeckbase }}/etc/framework.properties".)
rundeck_framework:
  - parameter: framework.server.hostname
    value: "{{ ansible_fqdn }}"
  - parameter: framework.server.name
    value: "{{ ansible_hostname }}"
  - parameter: framework.projects.dir
    value: "{{ rundeck_rdeckbase }}/projects"
  - parameter: framework.var.dir
    value: "{{ rundeck_rdeckbase }}/var"
  - parameter: framework.logs.dir
    value: "{{ rundeck_rdeckbase }}/var/logs"
  # - parameter: "framework.server.username"
  #   value: unset
  # - parameter: "framework.server.password"
  #   value: unset
  - parameter: framework.rundeck.url
    value: "{{ rundeck_url }}"
  # - parameter: "framework.ssh.keypath"
  #   value: unset
  # - parameter: "framework.ssh.user"
  #   value: unset
  - parameter: framework.ssh-connect-timeout
    value: 0
  - parameter: framework.ssh-command-timeout
    value: 0
  # - parameter: "framework.log.dispatch.console.format"
  #   value: unset
  - parameter: framework.rundeck.execution.script.tokenexpansion.enabled
    value: yes

# default users stored in {{ rundeck_rdeckbase }}/server/config/realm.properties
rundeck_users:
  - username: "admin"
    password: "admin"
    roles: "user,admin"
  - username: "user"
    password: "user"
    roles: "user"

# Rundeck plugins to install
rundeck_plugins: []
# - https://github.com/Batix/rundeck-ansible-plugin/releases/download/3.1.1/ansible-plugin-3.1.1.jar
  • Access to a repository containing packages, likely on the internet.
  • A recent version of Ansible. (Tests run on the current, previous and next release of Ansible.)

The following roles can be installed to ensure all requirements are met, using ansible-galaxy install -r requirements.yml:

---
- robertdebock.bootstrap
- robertdebock.common
- robertdebock.core_dependencies
- robertdebock.java
- robertdebock.service

This role is a part of many compatible roles. Have a look at the documentation of these roles for further information.

Here is an overview of related roles: dependencies

This role has been tested on these container images:

container tags
el 7, 8
debian buster, bullseye
fedora 31, 32
opensuse all
ubuntu focal, bionic, xenial

The minimum version of Ansible required is 2.8 but tests have been done to:

  • The previous version, on version lower.
  • The current version.
  • The development version.

Some variarations of the build matrix do not work. These are the variations and reasons why the build won't work:

variation reason
alpine Shutting down rundeck:

This role refers to a version released by Rundeck. Check the released version(s) here:

This version reference means a role may get outdated. Monthly tests occur to see if bit-rot occured. If you however find a problem, please create an issue, I'll get on it as soon as possible.

Unit tests are done on every commit, pull request, release and periodically.

If you find issues, please register them in GitHub

Testing is done using Tox and Molecule:

Tox tests multiple ansible versions. Molecule tests multiple distributions.

To test using the defaults (any installed ansible version, namespace: robertdebock, image: fedora, tag: latest):

molecule test

# Or select a specific image:
image=ubuntu molecule test
# Or select a specific image and a specific tag:
image="debian" tag="stable" tox

Or you can test multiple versions of Ansible, and select images: Tox allows multiple versions of Ansible to be tested. To run the default (namespace: robertdebock, image: fedora, tag: latest) tests:

tox

# To run CentOS (namespace: `robertdebock`, tag: `latest`)
image="centos" tox
# Or customize more:
image="debian" tag="stable" tox

Apache-2.0

I'd like to thank everybody that made contributions to this repository. It motivates me, improves the code and is just fun to collaborate.

Robert de Bock

Please consider sponsoring me.

About

Install and configure rundeck on your system.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 100.0%