chef-cookbooks / aix

Resources for AIX hosts
https://supermarket.chef.io/cookbooks/aix
Apache License 2.0
23 stars 42 forks source link

Etchosts #82

Closed emreozkangit closed 6 years ago

emreozkangit commented 6 years ago

Cookbook version

chef-server 12.17.5 Redhat on ppc Chef dk 2.3.4 -- Redhat on x64

Chef-client version

client aix 7.2 - 13.6.4

Platform Details

client aix 7.2 - 13.6.4

Scenario:

etchosts module

Steps to Reproduce:

Synchronizing Cookbooks:

Running handlers: [2017-11-28T17:03:58+03:00] ERROR: Running exception handlers Running handlers complete [2017-11-28T17:03:58+03:00] ERROR: Exception handlers complete Chef Client failed. 0 resources updated in 05 seconds [2017-11-28T17:03:58+03:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out [2017-11-28T17:03:58+03:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report [2017-11-28T17:03:58+03:00] ERROR: aix_etchosts[demolpar] (aix::default line 17) had an error: NameError: uninitialized constant Chef::Resource::AixEtchosts [2017-11-28T17:03:58+03:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

How can I resolve this problem?

emreozkangit commented 6 years ago

NameError: uninitialized constant Chef:

iennae commented 6 years ago

Thanks for reporting. The etchosts resource isn't Chef 13 compatible yet.

emreozkangit commented 6 years ago

Should I downgrade Client version? Which version?

iennae commented 6 years ago

It depends. It should work on the latest version of Chef 12. We also could work with you to get this resource updated for Chef 13 if you had a node to test and verify the changes we make. Or if possible you could also submit a PR yourself to fix this resource. If you aren't sure how to do the PR, I could walk you through what would need to get changed.

emreozkangit commented 6 years ago

After I downgrade Client version on the latest version of Chef 12,I successfully updated.Thank you.

msgarbossa commented 6 years ago

I updated the etchosts custom resource in PR #83 to work with Chef 13. It worked in all of my testing. The code is mostly the same as before except for the required conversions for Chef 13. The delete_all action is also fixed (#77). The way aliases are handled does not seem very reliable. In my testing, an alias only gets added if the primary name doesn't exist and changing existing aliases did not work as I expected. I prefer the hostsfile cookbook to handle /etc/hosts. I suspect it would work better for managing aliases. This resource is mostly redundant functionality done in an AIX-specific manner, but there could be some use-cases where this resource performs better on AIX due to the different approaches.

iennae commented 6 years ago

Version 2.1.0 of this cookbook should support the use of etchosts resource on Chef 13 hosts now @aaronemre. Thanks @msgarbossa for the PR to clean this up!