naftulikay / ansible-role-degoss

An Ansible role for installing, running, and removing Goss from a system without leaving any traces.
Other
42 stars 12 forks source link

Fileglob Fix #4

Closed sagagliardo closed 6 years ago

sagagliardo commented 7 years ago

Per https://github.com/ansible/ansible/issues/17136 , file glob has known issues in Ansible 2.2.0+ at the moment. Until this is resolved, I'm suggesting this PR to resolve this issue as an alternative to file glob.

Tests can be specified as either a single file or a path as an element in the tests array as well, as was previous behavior. The only change is that tests are now specified as an array vs a single string.

sagagliardo commented 7 years ago

Python 2.6 has some bugs with the functionality of lists and Ansible for some reason. When I bumped up Travis to 2.7 this was no longer an issue.

sagagliardo commented 7 years ago

@naftulikay Anything else I need to address here before we get this bad boy merged?

naftulikay commented 7 years ago

I'm not entirely certain that this is even needed. Can you detail an exact use-case which this solves for?

sagagliardo commented 7 years ago

Looks like whatever it was being blocked by that was 2.7 specific is resolved, possibly by changes on your end? Passing now.

sagagliardo commented 7 years ago

@naftulikay any update getting this merged?

naftulikay commented 7 years ago

I'm not entirely certain that this is even needed. Can you detail an exact use-case which this solves for?

If this is a bug in Ansible, then I don't see an urgency in fixing it in all downstream roles.

naftulikay commented 7 years ago

@sagagliardo Now that the refactor is complete, I do not see the need for this PR anymore, please see latest master and #6.

There are three variables now that control file and directory copying:

goss_file: goss.yml
goss_addtl_files: []
goss_addtl_dirs: []

These are their defaults. This is how they are used:

- name: deploy test files
  copy: src={{ item }} dest={{ degoss_test_root }}
  with_items: "{{ [goss_file] + goss_addtl_files + goss_addtl_dirs }}"
  changed_when: degoss_changed_when