mattandes.jenkins_slave_win
Ansible Role: Jenkins Slave - Windows
This role sets up a Jenkins Windows slave by using the agent.jar file from the Jenkins master. It creates a Windows service with NSSM to help manage and start the agent.jar automatically when the computer starts.
Requirements
- You need Administrator access on the Windows slave machine.
- A running Jenkins master (by default, it assumes this is at http://localhost:8080).
- The Windows slave must be listed in the Jenkins node section, and its name should match the Windows hostname in lowercase.
Role Variables
Here are the available variables with their default values (found in defaults/main.yml
):
jenkins_slave_win_user:
jenkins
- This is the Windows user that the Jenkins slave will run as.
jenkins_slave_win_password:
jenkins
- The password for the Windows user running the Jenkins slave.
jenkins_slave_win_create_user:
true
- This decides if the specified Jenkins user should be created as a local Windows user account.
jenkins_slave_win_dir:
"C:\\Jenkins"
- The folder that the Jenkins slave will use for its work. It should match the
Remote root directory
setting in Jenkins. This folder will be created if it doesn't already exist.
- The folder that the Jenkins slave will use for its work. It should match the
jenkins_slave_win_jenkins_url:
http://localhost:8080
- The URL for the Jenkins master that the slave should connect to. The node should already be set up on the master, ideally using the JSasC plugin.
jenkins_slave_win_jenkins_user:
admin
- The user for connecting to the Jenkins master to get the node's secret. This user should be able to manage nodes.
jenkins_slave_win_jenkins_password:
admin
- The password for the user connecting to the Jenkins master.
jenkins_slave_win_java_args:
"-Xmx768m"
- A variable to add extra Java arguments when starting the slave agent.
Dependencies
There are no dependencies.
Example Playbook
- hosts: jenkins-slaves-win
become: yes
vars:
jenkins_slave_win_jenkins_url: "http://jenkins:8080"
roles:
- role: mattandes.jenkins_slave_win
License
MIT
Informazioni sul progetto
Ansible role to setup a Jenkins Windows slave installed as a service via NSSM
Installa
ansible-galaxy install mattandes.jenkins_slave_win
Licenza
Unknown
Download
142
Proprietario