Security Automation with Ansible 2
上QQ阅读APP看书,第一时间看更新

Jenkins Ansible integration configuration

Not surprisingly, Jenkins supports SCM to use playbooks and local directories for manual playbooks too. This can be configured with the build options. Jenkins supports both ad-hoc commands and playbooks to trigger as a build (or) post-build action.

The following screenshot shows how we can point our repository and specify a branch as well. We can also specify credentials if we want to access private repositories:

Adding Github (SCM) based playbooks for build

Then we can add the Playbook path by specifying the location of the playbook and defining inventory and variables as required:

Start playbook execution when build triggers

Finally, we can execute the Jenkins job by triggering the Jenkins build (or) we can integrate this with other tools:

Jenkins build output of playbook execution