I have a playbook that checks the list of installed plugins for 6 jenkins servers.
Here is the hostfile:
[masters]
server1
server2
server3
server4
server5
server6
Here is the task within the playbook that handles obtaining the list of installed plugins:
- name: Obtaining a list of Jenkins Plugins
jenkins_script:
script: 'println(Jenkins.instance.pluginManager.plugins)'
url: "{{ item }}"
user: 'admin'
password: 'password'
with_items:
- 'url1'
- 'url2'
- 'url3'
- 'url4'
- 'url5'
- 'url6'
This runs perfectly fine, but prints out 36 lists of installed plugins rather than just 6. It appears that the playbook is plugging every url in for each of the hosts, however I'm fairly new to ansible, so does anyone know how to get around this issue?