Hi Kirill,
I am now sure, if all of these will work in your particular use case, but I was able to achieve all three points mentioned programatically with Groovy script in init.groovy.d. Although I'm using Jenkins 2.x, I expect it also should work with older versions.
1. I use Job DSL plugin for this. Just place following script to init.groovy.d:
import javaposse.jobdsl.dsl.DslScriptLoader
import javaposse.jobdsl.plugin.JenkinsJobManagement
def workspace = new File('.')
def jobManagement = new JenkinsJobManagement(System.out, [:], workspace)
new DslScriptLoader(jobManagement).runScript("job('test')")
2. One option would be to try
Jenkins.instance.reload(). I achieve this by running following script in
init.groovy.d:
def locationConfig = Jenkins.instance.getDescriptor('JenkinsLocationConfiguration')
locationConfig.setUrl("<YOUR_LOCATION>")
3. Again,
Jenkins.instance.reload() might help. Jenkins actually uses master key (which is different for every setup) to encode passwords. If you configure RabbitMQ programatically, you can put a proper hash right away with:
new hudson.util.Secret("<PLAIN_TEXT_PASSWORD>")
Hope it helps.
Cheers,
Petr