Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39611

ansible / ansible-playbook -i option is not supported via a parameter in Jenkins job inside Invoke Ansible build step

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Not A Defect
    • Icon: Major Major
    • ansible-plugin
    • None

      ansible / ansible-playbook -i option is not supported via a parameter in Jenkins job inside Invoke Ansible build step, when INVENTORY method type is "inline content". If a variable/parameter contains hosts info comma, space+comma separated, then it's marking the ansible playbook run failed by not finding the hosts individually. Instead of treating "host1, host2" or "host1,host3" as separated hosts, Ansible is trying to find "host1, host2" as a SINGLE hostname.

      There should be a 3rd radio button which should support -i option (available in ansible / ansible-playbook command) which says, that -i option can also specify a list of host(s) comma separated.
      It doesn't make much sense to use a variable (${variable}) directly inside "inline content" (as inline content actually means valid inline data) like I was trying to do, but I didn't want to create a FILE (on the fly) and use that instead of "inline content" radio button. The workaround of creating a inventory file, using "File" radio button / method within "Invoke Ansible Playbook" actually worked but I was trying to use just a plain "${variable}" and my assumption was it should treat that within this plugin like we pass -i option as command line. So, an enhancement of having a 3rd radio button would help a lot i.e. 3rd radio button (Comma separated) and a user can just specify "${myHosts}" and be done with it (instead of creating a FILE or writing a proper INLINE inventory file).

      For more info: See this link: http://stackoverflow.com/questions/40498752/ansible-playbook-command-line-jenkins-ansible-plugin-parameter-not-accepting

            sirot Jean-Christophe Sirot
            giga Arun Sangal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: