Sure. Once again for reference, here's that path from the error message: [u'/Volumes/Data/Projects/vlad/vlad/vlad/playbooks/"../settings.yml", "../example.settings.yml"']
Disregarding the wrapping square brackets, the wrapping single quotes and the preceding "u" gives us: /Volumes/Data/Projects/vlad/vlad/vlad/playbooks/"../settings.yml", "../example.settings.yml" Now look at where the first and second double quotes are. That looks funky to me. Surely the first element in the array should be entirely wrapped in double quotes? Also, having '../' anywhere other than at the start of a path is surely going to cause problems. It appears as if Ansible is prefixing an absolute path (the path to the playbook making the call: /Volumes/Data/Projects/vlad/vlad/vlad/playbooks/) to my expanded variable, irrespective of what my variable contains. This in turn is making the expanded variable a bit garbled, hence the error. On Wednesday, 3 September 2014 12:42:38 UTC+1, Michael DeHaan wrote: > > "settings_files: '"../settings.yml", "../example.settings.yml"' > > It should be noted this is not a YAML list, and that is probably part of > your problem. > > The path being an array of unicode elements does not look strange to me. > Is there a particular path element in the list that looks strange to you? > > > On Wed, Sep 3, 2014 at 5:28 AM, Dan Bohea <[email protected] <javascript:>> > wrote: > >> Thanks for the suggestion but I already tried that and it results in a >> huge error: >> >> Traceback (most recent call last): >> File "/usr/local/Cellar/ansible/1.7.1/libexec/bin/ansible-playbook", >> line 5, in <module> >> pkg_resources.run_script('ansible==1.7.1', 'ansible-playbook') >> File >> "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", >> >> line 489, in run_script >> self.require(requires)[0].run_script(script_name, ns) >> File >> "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", >> >> line 1207, in run_script >> execfile(script_filename, namespace, namespace) >> File >> "/usr/local/Cellar/ansible/1.7.1/lib/python2.7/site-packages/ansible-1.7.1-py2.7.egg/EGG-INFO/scripts/ansible-playbook", >> >> line 309, in <module> >> sys.exit(main(sys.argv[1:])) >> File >> "/usr/local/Cellar/ansible/1.7.1/lib/python2.7/site-packages/ansible-1.7.1-py2.7.egg/EGG-INFO/scripts/ansible-playbook", >> >> line 249, in main >> pb.run() >> File >> "/usr/local/Cellar/ansible/1.7.1/lib/python2.7/site-packages/ansible-1.7.1-py2.7.egg/ansible/playbook/__init__.py", >> >> line 339, in run >> if not self._run_play(play): >> File >> "/usr/local/Cellar/ansible/1.7.1/lib/python2.7/site-packages/ansible-1.7.1-py2.7.egg/ansible/playbook/__init__.py", >> >> line 646, in _run_play >> play.update_vars_files(all_hosts, vault_password=self.vault_password) >> File >> "/usr/local/Cellar/ansible/1.7.1/lib/python2.7/site-packages/ansible-1.7.1-py2.7.egg/ansible/playbook/play.py", >> >> line 698, in update_vars_files >> self._update_vars_files_for_host(h, vault_password=vault_password) >> File >> "/usr/local/Cellar/ansible/1.7.1/lib/python2.7/site-packages/ansible-1.7.1-py2.7.egg/ansible/playbook/play.py", >> >> line 847, in _update_vars_files_for_host >> filename2, filename3, filename4 = generate_filenames(host, inject, >> filename) >> File >> "/usr/local/Cellar/ansible/1.7.1/lib/python2.7/site-packages/ansible-1.7.1-py2.7.egg/ansible/playbook/play.py", >> >> line 775, in generate_filenames >> filename4 = utils.path_dwim(self.basedir, filename3) >> File >> "/usr/local/Cellar/ansible/1.7.1/lib/python2.7/site-packages/ansible-1.7.1-py2.7.egg/ansible/utils/__init__.py", >> >> line 318, in path_dwim >> if given.startswith("/"): >> AttributeError: 'list' object has no attribute 'startswith' >> >> I'm guessing that this is the most useful part of that error: >> >> AttributeError: 'list' object has no attribute 'startswith' >> >> Out of curiosity, I wrapped each path string in the list with double >> quotes but it results in pretty much the same thing. >> >> On Wednesday, 3 September 2014 07:24:16 UTC+1, Tomasz Kontusz wrote: >>> >>> >>> >>> Michael DeHaan <[email protected]> napisał: >>> >What were you expecting? >>> > >>> >It's saying none of the files in the list were found and hitting an >>> >error >>> >condition, but I'm unclear which parts you find unusual. >>> >>> The path in the error looks strange ;-) >>> >>> >On Tue, Sep 2, 2014 at 11:05 AM, Dan Bohea <[email protected]> wrote: >>> > >>> >> So I just recently discovered how to list several possible >>> >vars_files, >>> >> with precedence, and where some may not exist: >>> >> >>> >> >>> >> >>> >http://serverfault.com/questions/589734/ansible-can- >>> i-use-vars-files-when-some-files-do-not-exist >>> >> >>> >> Very handy. Where is the documentation for this? >>> >> >>> >> >>> >> Next question... >>> >> >>> >> I'd like to centralise a list of possible vars_files in a single >>> >variable >>> >> but can't get it to work. E.g: >>> >> >>> >> vars_files: >>> >> - [ "{{ settings_files }}" ] >>> >> >>> >> and then in say group_vars/all I have my files defined: >>> >> >>> >> settings_files: '"../settings.yml", "../example.settings.yml"' >>> >>> I think you want to create a list here, like this: >>> >>> settings_files: >>> - ../settings.yml >>> - ../example.settings.yml >>> >>> And then use it like this: >>> >>> vars_files: >>> - "{{ settings_files }}" >>> >>> >> But that doesn't work - I get the following error: >>> >> >>> >> vlad: not importing file: >>> >> /Volumes/Data/Projects/vlad/vlad/vlad/playbooks/"../settings.yml", >>> >> "../example.settings.yml" >>> >> ERROR: vlad: FATAL, no files matched for vars_files import sequence: >>> >> [u'/Volumes/Data/Projects/vlad/vlad/vlad/playbooks/"../settings.yml", >>> >>> >> "../example.settings.yml"'] >>> >> >>> >> It looks like something is happening on expansion that I wasn't >>> >expecting. >>> >> >>> >> I'm hoping this is just a question of syntax and I've messed around >>> >with a >>> >> few variations but am still having no luck. >>> >> >>> >> Can anyone help with this? Is it even possible? >>> >> >>> >> I'm running Ansible v1.7.1. >>> >> >>> >> -- >>> >> You received this message because you are subscribed to the Google >>> >Groups >>> >> "Ansible Project" group. >>> >> To unsubscribe from this group and stop receiving emails from it, >>> >send an >>> >> email to [email protected]. >>> >> To post to this group, send email to >>> >[email protected]. >>> >> To view this discussion on the web visit >>> >> >>> >https://groups.google.com/d/msgid/ansible-project/ >>> fce326b0-5489-45b7-976c-58e8a3e11769%40googlegroups.com >>> >> >>> ><https://groups.google.com/d/msgid/ansible-project/ >>> fce326b0-5489-45b7-976c-58e8a3e11769%40googlegroups. >>> com?utm_medium=email&utm_source=footer> >>> >> . >>> >> For more options, visit https://groups.google.com/d/optout. >>> >> >>> >>> -- >>> Wysłane za pomocą K-9 Mail. >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ansible Project" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/68da09fe-bcbc-4ca5-a1ee-3e7ddaafb1eb%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/68da09fe-bcbc-4ca5-a1ee-3e7ddaafb1eb%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f2f992ff-7d73-47a4-83ba-43dbf1e59f4f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
