infra-ansible/roles/jenkins/tasks/main.yml
Ricardo Carrillo Cruz 993ebdf54c Add jenkins role and top-level playbook
This role creates the JJB user on Jenkins and kicks-off
a jenkins-jobs update run.
2015-04-15 13:21:51 +02:00

17 lines
583 B
YAML

---
# Download Jenkins CLI
- get_url: url=http://localhost:8080/jnlpJars/jenkins-cli.jar dest=/tmp/jenkins-cli.jar
register: result
until: result|success
retries: 5
delay: 10
# Create JJB user
- shell: echo 'hpsr=new hudson.security.HudsonPrivateSecurityRealm(false); hpsr.createAccount("gerrig", "gerrig")' | java -jar /tmp/jenkins-cli.jar -s http://localhost:8080 groovy =
no_log: True
# Trigger jenkins-jobs update in fire&forget mode, since it takes a long time to complete
- command: jenkins-jobs update /etc/jenkins_jobs/config --delete-old
async: 3600
poll: 0