From d6943e46ef4b4009f1ed029499c9ac7f03013e29 Mon Sep 17 00:00:00 2001 From: Sven Schliesing Date: Mon, 31 Mar 2014 14:32:07 +0200 Subject: [PATCH 1/2] Example for queueing build in Jenkins --- library/network/uri | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/network/uri b/library/network/uri index 71954fc20f3..6f5ab725307 100644 --- a/library/network/uri +++ b/library/network/uri @@ -160,6 +160,14 @@ EXAMPLES = ''' # access the app in later tasks. - action: uri url=https://your.form.based.auth.example.com/dashboard.php method=GET return_content=yes HEADER_Cookie="{{login.set_cookie}}" + +# Queue build of a project in Jenkins: +- action: uri url=http://{{jenkins.host}}/job/{{jenkins.job}}/build?token={{jenkins.token}} + method=GET user={{jenkins.user}} password={{jenkins.password}} force_basic_auth=yes status_code=201 + +# Call Jenkins from host where you run ansible. Handy if the Henkins host isn't reachable from the target machine +- local_action: uri url=http://{{jenkins.host}}/job/{{jenkins.job}}/build?token={{jenkins.token}} + method=GET user={{jenkins.user}} password={{jenkins.password}} force_basic_auth=yes status_code=201 ''' HAS_HTTPLIB2 = True From fb10ca73dc223afb98ba65f1384aaea8b62843e2 Mon Sep 17 00:00:00 2001 From: Sven Schliesing Date: Mon, 31 Mar 2014 14:32:56 +0200 Subject: [PATCH 2/2] Update uri --- library/network/uri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/network/uri b/library/network/uri index 6f5ab725307..3098c5f3902 100644 --- a/library/network/uri +++ b/library/network/uri @@ -165,7 +165,7 @@ EXAMPLES = ''' - action: uri url=http://{{jenkins.host}}/job/{{jenkins.job}}/build?token={{jenkins.token}} method=GET user={{jenkins.user}} password={{jenkins.password}} force_basic_auth=yes status_code=201 -# Call Jenkins from host where you run ansible. Handy if the Henkins host isn't reachable from the target machine +# Call Jenkins from host where you run ansible. Handy if the Jenkins host isn't reachable from the target machine: - local_action: uri url=http://{{jenkins.host}}/job/{{jenkins.job}}/build?token={{jenkins.token}} method=GET user={{jenkins.user}} password={{jenkins.password}} force_basic_auth=yes status_code=201 '''