Giter Club home page Giter Club logo

ansible-jenkins-swarm-agent's Introduction

Jenkins Agent

Build Status

This role sets up a Jenkins agent with the Swarm client on a Windows/Ubuntu/CentOS machine.

Requirements

  • Jenkins master with the Swarm client
  • Ansible 2.2 due to use of some new Windows modules

Role Variables

Variable Name Default Description
jenkins_agent_master_port 8080 Port that Jenkins main UI is listening on
jenkins_agent_username sa_swarm_agent User account to use while authenticating to
jenkins_agent_password {{ lookup('password', '../credentials/{{ inventory_hostname }}/jenkins-agent/agent-password.txt') }} A password to authenticate against the Jenkins Master
jenkins_agent_name {{ inventory_hostname }} How this agent will show up in the UI
jenkins_agent_num_executors {{ ansible_processor_cores*2 }} Number of executors for running jobs
jenkins_agent_labels {{ (ansible_os_family|lower() == 'windows')|ternary('windows', 'linux') }} A space separated list of labels, for restricting jobs
jenkins_agent_labels_file {{ jenkins_swarm_path }}/labels.swarm A file to hold the labels and add/remove dynamically (Swarm client 3.3 and above)
jenkins_agent_log_file {{ jenkins_swarm_path }}/swarm.log Where the swarm agent will log to
jenkins_agent_additional_args [deleteExistingClients, disableClientsUniqueId] Additional arguments to send to the Swarm client jar
jenkins_swarm_client_version 3.6 Version of the Swarm client to download
jenkins_plugins_url https://repo.jenkins-ci.org Base URL to download the client
jenkins_plugins_repo_path releases/org/jenkins-ci/plugins/swarm-client/{{ jenkins_swarm_client_version }} URL between the base URL and the jar file name
jenkins_swarm_client_jar swarm-client-{{ jenkins_swarm_client_version }}.jar The file name for the swarm client jar
jenkins_swarm_download_url {{ jenkins_plugins_url }}/{{ jenkins_plugins_repo_path }}/{{ jenkins_swarm_client_jar }} Full URL to the Swarm client jar
jenkins_swarm_path /var/lib/jenkins Path to the swarm client jar file
jenkins_swarm_config_path /etc/jenkins For CentOS while it is using the init.d setup, this is where the swarm-client settings are stored
jenkins_swarm_task_name Jenkins Swarm Client Description for systemd
jenkins_swarm_systemd_path /lib/systemd/system Path to systemd folder
jenkins_swarm_service_name swarm-client Name of the systemd service
jenkins_swarm_client_wrapper_version 2.0.3 Windows Service Wrapper version
jenkins_swarm_wrapper_download_url {{ jenkins_plugins_url}}/releases/com/sun/winsw/winsw/{{ jenkins_swarm_client_wrapper_version }}/winsw-{{jenkins_swarm_client_wrapper_version}}-bin.exe Full URL to the Windows Service Wrapper exe
win_base_jenkins_path C:\jenkins Base path for the Jenkins agent
win_swarm_client_jar_path {{ win_base_jenkins_path }}\{{ jenkins_swarm_client_jar }} Path to the Swarm client jar file
win_swarm_client_wrapper_path {{ win_base_jenkins_path }}\{{ jenkins_swarm_client_jar|replace('.jar', '.exe') }} Path to the service wrapper exe
win_swarm_client_wrapper_config_path {{ win_base_jenkins_path }}\{{ jenkins_swarm_client_jar|replace('.jar', '.xml') }} Path to the service wrapper config file

Example Playbook

- hosts: jenkins_agents
  vars:
    jenkins_agent_master: "{{ hostvars.example_master.ansible_host }}",
    jenkins_agent_num_executors: 8,
    jenkins_agent_labels: "Windows dotnet swarm msbuild"

  roles:
    - wurbanski.jenkins-swarm-agent

ansible-jenkins-swarm-agent's People

Contributors

b-kirby avatar wurbanski avatar jablonskim avatar climebil avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.