ahelal / kitchen-ansiblepush

test-kitchen plugin to use ansible in push mode
41 stars 22 forks source link

Use of .kitchen/ansiblepush/ansiblepush_*.yml for inventory seems problematic #70

Open gkranis opened 1 year ago

gkranis commented 1 year ago

Potential concurrency issue

Lets assume that i have

The yml file for all these suites' inventory would be something like .kitchen/ansiblepush/ansiblepush_ubuntu1804.yml (so same file) What happens when we run kitchen with --parallel? seems race-y. Can we fixed with option use_instance_name: true so that hostnames are unique.

--limit does not isolate

The kitchen-ansible-inventory binary looks like it concatenates all .kitchen/ansiblepush/ansiblepush_*.yml into a single inventory. This means that after multiple suites have run the inventory would contain not only the hosts for the current suite but previous suites as well. The ruby code attempts to workaround this by using --limit. However --limit does not truly isolate the playbook for the other hosts. One example is playbooks that iterate over all hostvars: They will see the hostvars of the other hosts.Therefore suites are not really isolated from each other. See https://github.com/ansible/ansible/issues/14141#issuecomment-253647272 for how --limit interacts with hostvars.

Sorry if some of the above is wrong. I'm trying to migrate from kitchen-ansible to kitchen-ansiblepush so I did a quick assessment