From 7ea66077cca628c1ea5ef00f9ca80da9863efb87 Mon Sep 17 00:00:00 2001 From: Ricardo Carrillo Cruz Date: Wed, 15 Apr 2015 15:00:58 +0200 Subject: [PATCH] Rename jenkins playbooks/role for post_puppet_jenkins --- post_puppet_jenkins.yml | 7 +++++++ roles/post_puppet_jenkins/tasks/main.yml | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 post_puppet_jenkins.yml create mode 100644 roles/post_puppet_jenkins/tasks/main.yml diff --git a/post_puppet_jenkins.yml b/post_puppet_jenkins.yml new file mode 100644 index 0000000..56afd25 --- /dev/null +++ b/post_puppet_jenkins.yml @@ -0,0 +1,7 @@ +--- +# file: bootstrap_puppetmaster.yml +- hosts: meta-infra_type_jenkins + user: ubuntu + sudo: true + roles: + - { role: post_puppet_jenkins } diff --git a/roles/post_puppet_jenkins/tasks/main.yml b/roles/post_puppet_jenkins/tasks/main.yml new file mode 100644 index 0000000..1dc4d9e --- /dev/null +++ b/roles/post_puppet_jenkins/tasks/main.yml @@ -0,0 +1,16 @@ +--- +# 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