The GPII Jenkins server delegates project jobs to multiple Linux and Windows hosts. The ansible-jenkins role can be used to deploy a Jenkins server but work needs to be done (maybe in a separate ansible-jenkins-node role?) to automate the deployment of nodes where the jobs are run.
The work should ideally be tested using Vagrant to set up a Jenkins VM and a node that it can communicate with.
Preference should be given to using the Jenkins API with Groovy scripts instead of relying on configuration templates as the latter might not be future proof.
Jenkins node port security needs to be configured:
TCP port for JNLP slave agents (Fixed, and then specify port number)
A few node settings should be configurable:
No. of executors:
Remote root directory:
Labels: (so far only one label per node has been assigned in practice)
Usage: (both options are used depending on the type of node being added)
Launch method: (at least the SSH and Java Web Start methods)
When using the Java Web Start method, a node secret is provided. That secret should be captured and stored on the Jenkins node:
$ cat /etc/jenkins/win10_node_secret.conf
$ cat /home/jenkins/bin/set-jenkins-win10-node-secret.sh
vagrant winrm -e -c "setx JENKINS_WIN10_NODE_SECRET $JENKINS_WIN10_NODE_SECRET"