Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set 'Enable Slave → Master Access Control' from script console

Tags:

jenkins

groovy

How can I toggle on Jenkins' Enable Slave -> Master Access Control (listed under Configure System), control from a Groovy script run using the script console?

I suspect the answer will involve the MasterKillSwitchConfiguration class.

like image 345
Liam M Avatar asked Jun 05 '26 03:06

Liam M


1 Answers

Answer is:

Jenkins.instance.injector.getInstance(AdminWhitelistRule.class)
    .setMasterKillSwitch(false);
Jenkins.instance.save()
like image 117
Liam M Avatar answered Jun 08 '26 00:06

Liam M