Are you familiar with groovy syntax? To play around you can setup a 
pipeline job and create stages for the steps that you want the job to 
handle.

here is an example stage where yu call a playbook with parameters

stage('deploy') {
  if ("${DEPLOY_FLAG}" == "true") {
    // def SSH_KEY='<path>/deploy_id_rsa'
    def DEP_PLAYBOOK='<path>/deploy_app.yml'
    sh "ansible-playbook --private-key=${SSH_KEY} -b -e 
MY_WORKSPACE=${workspace}  ${DEP_PLAYBOOK} -l ${DEPLOY_TARGET}"
  }
}


it works nicely and you can see the status of the stages on the job home 
page.

So an example job which builds and deploys might have stages where you 

- pull from source mgmnt
- verify
- build
- build test
- deploy to canary
- sanity check
- deploy
- deploy verification
- tests ...
- post deploy notification

All in one script -

Note in my example the conditional - you can set that either in the gui or 
in github post hooks etc. So the same pipeline file can handle build tests 
as well as deploys, etc

I would dive in and sandbox until yuo get comfortable


On Wednesday, February 14, 2018 at 11:25:49 AM UTC-5, Sidh wrote:
>
> Hi,
>
> Anyone using ansible with jenkins pipeline ?
>
> Can you please point me to some documentation with examples ?
>
> Regards,
> Sidh
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fba2b05c-ab41-4462-bf35-de55faf4a06e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to