Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

am i using try_templates() correctly? #5

Open
brianjmurrell opened this issue Oct 28, 2015 · 3 comments
Open

am i using try_templates() correctly? #5

brianjmurrell opened this issue Oct 28, 2015 · 3 comments

Comments

@brianjmurrell
Copy link

I have:

template "/etc/cobbler/zone_templates/#{zone}" do
  source try_templates(["#{zone}.erb", "generic.erb"])
  mode 0644
  variables(:cobbler => node[:config][:cobbler],
            :config => node[:config],
            :ipa_ips => ipa_ips,
            :static_entries => static_entries)
    notifies :run, resources(:execute => "cobbler_sync")
  end
end

when there is no #{zone}.erb template file but there is a generic.erb template file.

I am getting the error:

Chef::Exceptions::FileNotFound
------------------------------
Cookbook 'cobbler' (0.0.1) does not contain a file at any of these locations:
  templates/centos-7.1.1503/example.com.erb
  templates/centos/example.com.erb
  templates/default/example.com.erb

when the value of zone is example.com.

I would have thought that because the ``example.com.erbtemplate file didn't exist it would be skipped over andgeneric.erb` would have been used.

@brianjmurrell
Copy link
Author

Anything on this? It seems like a pretty simple question which I would think should only take a couple of minutes to provide some assistance on please.

@brianjmurrell
Copy link
Author

Has this project been abandoned?

@mpasternacki
Copy link
Member

It's not actively developed at the moment; apologies for the late response.

It should work as you expect, though – it may be a regression. With which version of Chef client are you experiencing the issues? This functionality has been developed with Chef client version 11, and I don't think I'm using this feature in any cookbook with Chef client 12 now, so I might not have noticed the regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants