debops / ansible-apt

Configure and manage APT Package Manager
GNU General Public License v3.0
10 stars 15 forks source link

Fix : use relative path when using with_first_found #69

Closed jfefe closed 8 years ago

jfefe commented 8 years ago

'with_first_found' lookup into {files,templates} directory so we must use relative path for vars/* (See https://github.com/ansible/ansible/issues/14454)

$ ansible --version ansible 2.2.0

jfefe commented 8 years ago

After ansible upgrade, bus is still here when no relative path set.

You're welcome to test this with different version before merging it :)

drybjed commented 8 years ago

Is this compatible with current stable Ansible release, stable-2.0? This will most likely pass on Travis since it uses devel branch for testing. I'm not sure if I should merge it just yet, since I don't want to break compatibility with stable release and i prefer to use new Ansible features in roles after they are available in stable version.

jfefe commented 8 years ago

tested with ansible 2.0.2.0 : seems to be working with and without relative path :)

- name: "Debug with_first_found"
  include_vars: '{{ item }}'
  with_first_found: ['../vars/apt__default_sources_debian.yml']
  tags: ['debug']

- name: Load default APT sources configuration
  include_vars: '{{ item }}'
  with_first_found:
     - 'apt__default_sources_{{ apt__default_sources_lookup | lower }}.yml'
     -  'apt__default_sources.yml'
   when: True
   tags: ['debug']

Results :

TASK [debops.apt : Debug with_first_found] *************************************
ok: [host] => (item=***debops/debops-playbooks/roles/debops.apt/templates/../vars/apt__default_sources_debian.yml)

TASK [debops.apt : Load default APT sources configuration] *********************
ok: [host] => (item=***debops/debops-playbooks/roles/debops.apt/vars/apt__default_sources_debian.yml)
drybjed commented 8 years ago

@jfefe Great, then I'll merge it in, let's see if anybody reports issues. :-)