Peter Kahn
Peter Kahn

Reputation: 13046

How do you force Jenkins Ansible Plugin to set log level

I want to set ansible playbook execution to verbose -vvv when jenkins runs the playbook via the Ansible Plugin.

However, https://github.com/jenkinsci/ansible-plugin doesn't appear to have a verbose or log level as a part of it and I don't see any other way to push the -vvv element on to command line.

Is there a way to set log level in the playbook itself?

Upvotes: 8

Views: 8399

Answers (1)

Travenin
Travenin

Reputation: 1590

To set Jenkins Ansible Plugin log level in Pipeline Script you can use extras parameter in ansiblePlaybook function to add command line arguments. Example:

node {
    ansiblePlaybook( 
        playbook: 'path/to/playbook.yml',
        extras: '-vvv' )
}

Upvotes: 11

Related Questions