Opscode nginx_site disable not working as expected

Hi,
I installed the nginx using the opscode cookbook nginx https://github.com/opscode-cookbooks/nginx

And this is the last code of my recipe:


nginx_site ‘default’ do
action :disable
end

nginx_site app_name do
action :enable
end

After going into /etc/ngins/sites-enabled, I see:

lrwxrwxrwx 1 root root 34 Apr 4 08:38 000-default -> /etc/nginx/sites-available/default
lrwxrwxrwx 1 root root 37 Apr 4 08:32 harstorage -> /etc/nginx/sites-available/harapp

The question is, why just instead of removing the symlink, it renamed from default to 00-default?
It should have removed the link, why this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com (http://nepalonrails.tumblr.com)
http://funsole.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

To disable the pre-installed default site, you probably need to do:

nginx_site '000-default' do
action :disable
end

instead.

This is probably a bug in the cookbook (I admit, I wrote the disable
part a long time ago, and at the time it worked for me), since there's
supposed to be an attribute you can use to control this behavior. Ref:
https://github.com/opscode-cookbooks/nginx/blob/master/attributes/default.rb#L80

If that doesn't work, feel free to report a bug, and send it my way.

Some packages may auto-enable the default site, and since nginx reads
site definitions alphabetically, it is common for the file to be named
000-default to be the first one loaded.

-M

On Thu, Apr 4, 2013 at 4:49 AM, Sachin Sagar Rai millisami@gmail.com wrote:

Hi,
I installed the nginx using the opscode cookbook nginx
GitHub - sous-chefs/nginx: Development repository for the nginx cookbook

And this is the last code of my recipe:


nginx_site 'default' do
action :disable
end

nginx_site app_name do
action :enable
end

After going into /etc/ngins/sites-enabled, I see:

lrwxrwxrwx 1 root root 34 Apr 4 08:38 000-default ->
/etc/nginx/sites-available/default
lrwxrwxrwx 1 root root 37 Apr 4 08:32 harstorage ->
/etc/nginx/sites-available/harapp

The question is, why just instead of removing the symlink, it renamed from
default to 00-default?
It should have removed the link, why this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
http://funsole.com
Sent with Sparrow

Thanks,
But I just posted that 000-default, i forgot to say that previously when the nginx is installed, it was the default only.
Then I added the action :disable and ran again, it changed to 000-default


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com (http://nepalonrails.tumblr.com)
http://funsole.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Thursday, April 4, 2013 at 4:53 PM, Mike wrote:

To disable the pre-installed default site, you probably need to do:

nginx_site '000-default' do
action :disable
end

instead.

This is probably a bug in the cookbook (I admit, I wrote the disable
part a long time ago, and at the time it worked for me), since there's
supposed to be an attribute you can use to control this behavior. Ref:
https://github.com/opscode-cookbooks/nginx/blob/master/attributes/default.rb#L80

If that doesn't work, feel free to report a bug, and send it my way.

Some packages may auto-enable the default site, and since nginx reads
site definitions alphabetically, it is common for the file to be named
000-default to be the first one loaded.

-M

On Thu, Apr 4, 2013 at 4:49 AM, Sachin Sagar Rai <millisami@gmail.com (mailto:millisami@gmail.com)> wrote:

Hi,
I installed the nginx using the opscode cookbook nginx
GitHub - sous-chefs/nginx: Development repository for the nginx cookbook

And this is the last code of my recipe:


nginx_site 'default' do
action :disable
end

nginx_site app_name do
action :enable
end

After going into /etc/ngins/sites-enabled, I see:

lrwxrwxrwx 1 root root 34 Apr 4 08:38 000-default ->
/etc/nginx/sites-available/default
lrwxrwxrwx 1 root root 37 Apr 4 08:32 harstorage ->
/etc/nginx/sites-available/harapp

The question is, why just instead of removing the symlink, it renamed from
default to 00-default?
It should have removed the link, why this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
http://funsole.com
Sent with Sparrow

I had a bunch of trouble with this, so we wound up with this blunt
instrument:

On 4 April 2013 14:14, Sachin Sagar Rai millisami@gmail.com wrote:

Thanks,
But I just posted that 000-default, i forgot to say that previously when
the nginx is installed, it was the default only.
Then I added the action :disable and ran again, it changed to 000-default


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com http://nepalonrails.tumblr.com
http://funsole.com
Sent with Sparrow http://www.sparrowmailapp.com/?sig

On Thursday, April 4, 2013 at 4:53 PM, Mike wrote:

To disable the pre-installed default site, you probably need to do:

nginx_site '000-default' do
action :disable
end

instead.

This is probably a bug in the cookbook (I admit, I wrote the disable
part a long time ago, and at the time it worked for me), since there's
supposed to be an attribute you can use to control this behavior. Ref:

https://github.com/opscode-cookbooks/nginx/blob/master/attributes/default.rb#L80

If that doesn't work, feel free to report a bug, and send it my way.

Some packages may auto-enable the default site, and since nginx reads
site definitions alphabetically, it is common for the file to be named
000-default to be the first one loaded.

-M

On Thu, Apr 4, 2013 at 4:49 AM, Sachin Sagar Rai millisami@gmail.com
wrote:

Hi,
I installed the nginx using the opscode cookbook nginx
GitHub - sous-chefs/nginx: Development repository for the nginx cookbook

And this is the last code of my recipe:


nginx_site 'default' do
action :disable
end

nginx_site app_name do
action :enable
end

After going into /etc/ngins/sites-enabled, I see:

lrwxrwxrwx 1 root root 34 Apr 4 08:38 000-default ->
/etc/nginx/sites-available/default
lrwxrwxrwx 1 root root 37 Apr 4 08:32 harstorage ->
/etc/nginx/sites-available/harapp

The question is, why just instead of removing the symlink, it renamed from
default to 00-default?
It should have removed the link, why this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
http://funsole.com
Sent with Sparrow

--

I used the functionality at
https://github.com/opscode-cookbooks/nginx/blob/master/attributes/default.rb#L80
yesterday with success.

Expected result: empty sites-enabled directory barring any enabled sites.

Cheers,

AJ

On 5 April 2013 02:20, Sam sam.pikesley@gmail.com wrote:

I had a bunch of trouble with this, so we wound up with this blunt
instrument:
cuke-chef/site-cookbooks/odi-nginx/recipes/default.rb at master · theodi/cuke-chef · GitHub

On 4 April 2013 14:14, Sachin Sagar Rai millisami@gmail.com wrote:

Thanks,
But I just posted that 000-default, i forgot to say that previously when
the nginx is installed, it was the default only.
Then I added the action :disable and ran again, it changed to
000-default


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
http://funsole.com
Sent with Sparrow

On Thursday, April 4, 2013 at 4:53 PM, Mike wrote:

To disable the pre-installed default site, you probably need to do:

nginx_site '000-default' do
action :disable
end

instead.

This is probably a bug in the cookbook (I admit, I wrote the disable
part a long time ago, and at the time it worked for me), since there's
supposed to be an attribute you can use to control this behavior. Ref:

https://github.com/opscode-cookbooks/nginx/blob/master/attributes/default.rb#L80

If that doesn't work, feel free to report a bug, and send it my way.

Some packages may auto-enable the default site, and since nginx reads
site definitions alphabetically, it is common for the file to be named
000-default to be the first one loaded.

-M

On Thu, Apr 4, 2013 at 4:49 AM, Sachin Sagar Rai millisami@gmail.com
wrote:

Hi,
I installed the nginx using the opscode cookbook nginx
GitHub - sous-chefs/nginx: Development repository for the nginx cookbook

And this is the last code of my recipe:


nginx_site 'default' do
action :disable
end

nginx_site app_name do
action :enable
end

After going into /etc/ngins/sites-enabled, I see:

lrwxrwxrwx 1 root root 34 Apr 4 08:38 000-default ->
/etc/nginx/sites-available/default
lrwxrwxrwx 1 root root 37 Apr 4 08:32 harstorage ->
/etc/nginx/sites-available/harapp

The question is, why just instead of removing the symlink, it renamed from
default to 00-default?
It should have removed the link, why this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
http://funsole.com
Sent with Sparrow

--
Sam Pikesley | about.me

AJ,

Curious - what distro/package are you using?

-M

On Thu, Apr 4, 2013 at 4:35 PM, AJ Christensen aj@junglist.gen.nz wrote:

I used the functionality at
https://github.com/opscode-cookbooks/nginx/blob/master/attributes/default.rb#L80
yesterday with success.

Expected result: empty sites-enabled directory barring any enabled sites.

Cheers,

AJ

On 5 April 2013 02:20, Sam sam.pikesley@gmail.com wrote:

I had a bunch of trouble with this, so we wound up with this blunt
instrument:
cuke-chef/site-cookbooks/odi-nginx/recipes/default.rb at master · theodi/cuke-chef · GitHub

On 4 April 2013 14:14, Sachin Sagar Rai millisami@gmail.com wrote:

Thanks,
But I just posted that 000-default, i forgot to say that previously when
the nginx is installed, it was the default only.
Then I added the action :disable and ran again, it changed to
000-default


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
http://funsole.com
Sent with Sparrow

On Thursday, April 4, 2013 at 4:53 PM, Mike wrote:

To disable the pre-installed default site, you probably need to do:

nginx_site '000-default' do
action :disable
end

instead.

This is probably a bug in the cookbook (I admit, I wrote the disable
part a long time ago, and at the time it worked for me), since there's
supposed to be an attribute you can use to control this behavior. Ref:

https://github.com/opscode-cookbooks/nginx/blob/master/attributes/default.rb#L80

If that doesn't work, feel free to report a bug, and send it my way.

Some packages may auto-enable the default site, and since nginx reads
site definitions alphabetically, it is common for the file to be named
000-default to be the first one loaded.

-M

On Thu, Apr 4, 2013 at 4:49 AM, Sachin Sagar Rai millisami@gmail.com
wrote:

Hi,
I installed the nginx using the opscode cookbook nginx
GitHub - sous-chefs/nginx: Development repository for the nginx cookbook

And this is the last code of my recipe:


nginx_site 'default' do
action :disable
end

nginx_site app_name do
action :enable
end

After going into /etc/ngins/sites-enabled, I see:

lrwxrwxrwx 1 root root 34 Apr 4 08:38 000-default ->
/etc/nginx/sites-available/default
lrwxrwxrwx 1 root root 37 Apr 4 08:32 harstorage ->
/etc/nginx/sites-available/harapp

The question is, why just instead of removing the symlink, it renamed from
default to 00-default?
It should have removed the link, why this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
http://funsole.com
Sent with Sparrow

--
Sam Pikesley | about.me

Ubuntu 12.04

Cheers,

AJ

On 5 April 2013 09:58, Mike miketheman@gmail.com wrote:

AJ,

Curious - what distro/package are you using?

-M

On Thu, Apr 4, 2013 at 4:35 PM, AJ Christensen aj@junglist.gen.nz wrote:

I used the functionality at
https://github.com/opscode-cookbooks/nginx/blob/master/attributes/default.rb#L80
yesterday with success.

Expected result: empty sites-enabled directory barring any enabled sites.

Cheers,

AJ

On 5 April 2013 02:20, Sam sam.pikesley@gmail.com wrote:

I had a bunch of trouble with this, so we wound up with this blunt
instrument:
cuke-chef/site-cookbooks/odi-nginx/recipes/default.rb at master · theodi/cuke-chef · GitHub

On 4 April 2013 14:14, Sachin Sagar Rai millisami@gmail.com wrote:

Thanks,
But I just posted that 000-default, i forgot to say that previously when
the nginx is installed, it was the default only.
Then I added the action :disable and ran again, it changed to
000-default


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
http://funsole.com
Sent with Sparrow

On Thursday, April 4, 2013 at 4:53 PM, Mike wrote:

To disable the pre-installed default site, you probably need to do:

nginx_site '000-default' do
action :disable
end

instead.

This is probably a bug in the cookbook (I admit, I wrote the disable
part a long time ago, and at the time it worked for me), since there's
supposed to be an attribute you can use to control this behavior. Ref:

https://github.com/opscode-cookbooks/nginx/blob/master/attributes/default.rb#L80

If that doesn't work, feel free to report a bug, and send it my way.

Some packages may auto-enable the default site, and since nginx reads
site definitions alphabetically, it is common for the file to be named
000-default to be the first one loaded.

-M

On Thu, Apr 4, 2013 at 4:49 AM, Sachin Sagar Rai millisami@gmail.com
wrote:

Hi,
I installed the nginx using the opscode cookbook nginx
GitHub - sous-chefs/nginx: Development repository for the nginx cookbook

And this is the last code of my recipe:


nginx_site 'default' do
action :disable
end

nginx_site app_name do
action :enable
end

After going into /etc/ngins/sites-enabled, I see:

lrwxrwxrwx 1 root root 34 Apr 4 08:38 000-default ->
/etc/nginx/sites-available/default
lrwxrwxrwx 1 root root 37 Apr 4 08:32 harstorage ->
/etc/nginx/sites-available/harapp

The question is, why just instead of removing the symlink, it renamed from
default to 00-default?
It should have removed the link, why this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
http://funsole.com
Sent with Sparrow

--
Sam Pikesley | about.me