-
-
Notifications
You must be signed in to change notification settings - Fork 806
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
nginx_site resource doesn't work because it fails to reload the nginx service #505
Comments
I can confirm. nginx_site complains: |
This appears to be the same issue as the apache2 cookbook. I just tested this and it worked add this to your wrapper cookbook after your nginx_install section
|
Yes, I know that works. But this cookbook should fix it. |
This saved my research. Hoping the maintainers will update the code, so that we don't have to add this. Thanks for adding this snippet. |
fixed in #513 |
🗣️ Foreword
Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.
👻 Brief Description
Reloading the nginx service fails as part of the
nginx_site
process🥞 Cookbook version
10.0.1
👩🍳 Chef-Infra Version
15.2.20
🎩 Platform details
Ubuntu 18.04, running on VirtualBox.
Ruby 2.6.3p62
Steps To Reproduce
Steps to reproduce the behavior:
chef generate cookbook monster
monster/metadata.rb
, adding thenginx
dependency:depends 'nginx', '~> 10.0.1'
monster/recipes/default.rb
, and add these 2 lines at the end:yumyum.rb
with the following content:nginx
cookbook (version 10.0.1) onto the Chef server (I'm using Hosted Chef).monster
cookbook:knife cookbook upload monster
knife node run_list set vagrant 'recipe[monster]
vagrant ssh
sudo chef-client
🚓 Expected behavior
nginx should be installed and a bare-bones site called 'donuts' should be set up. The nginx service should also be running.
➕ Additional context
Here's what I get instead of a successful run:
I can verify nginx is running, but it has no
/etc/nginx/sites-enabled/donuts
.What's strange is that if you look just above the first error, you can see this line:
* service[nginx] action enable (up to date)
So the script clearly knows that
service[nginx]
exists at some level.Skimming the code I found this line:
nginx/resources/install.rb
Line 358 in d3579b9
A perfect declaration of the nginx service resource! So why isn't the nginx_site resource seeing it? Is it a scope issue with Chef?
BTW, I discovered I can work around this bug by copy/pasting that exact service resource block into my default recipe. Everything works fine then... but that seems like it's the nginx_site resource's responsibility to set that up correctly.
The text was updated successfully, but these errors were encountered: