Add post jenkins role and top-level playbook

This commit is contained in:
Ricardo Carrillo Cruz 2015-04-18 22:45:44 +02:00
parent 0756780c5b
commit 894b6e14ea
2 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,5 @@
---
# file: bootstrap_puppetmaster.yml
# file: post_puppet_jenkins.yml
- hosts: meta-infra_type_jenkins
user: ubuntu
sudo: true

View File

@ -1,4 +1,10 @@
---
# Get JJB user password from Hiera
- command: hiera -c /etc/puppet/hiera.yaml jenkins_jobs_password environment=production
delegate_to: "{{ groups['meta-infra_type_puppetmaster'][0] }}"
register: jenkins_jobs_password
no_log: True
# Download Jenkins CLI
- get_url: url=http://localhost:8080/jnlpJars/jenkins-cli.jar dest=/tmp/jenkins-cli.jar
register: result
@ -7,7 +13,7 @@
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 =
- shell: echo 'hpsr=new hudson.security.HudsonPrivateSecurityRealm(false); hpsr.createAccount("gerrig", "{{ jenkins_jobs_password }}")' | 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