Vagrant's add_role not working

This may be more of a vagrant question, but, I have this in my Vagrantfile:

config.vm.provision :chef_solo do |chef|
chef.node_name = "test01.slicetest.com"
chef.environment = "dev"
chef.cookbooks_path = "…/…/chef-cookbooks"
chef.data_bags_path = "…/…/chef-sauce/data_bags"
chef.environments_path = "…/…/chef-sauce/environments"
chef.roles_path = "…/…/chef-sauce/roles"
chef.add_role (“role-base”)
chef.run_list = [
“recipe[slice-swap::default]”
]
end

The chef.add_role() isn’t working. The roles_path above it is valid. I
tried chef.add_role(“bogus”) and there was no error reported. It seems the
role just isn’t there. This is vagrant 1.6.5 and chef 11.14.0.alpha.1

Doug

I’m pretty sure I saw somewhere that roles support is broken in vagrant 1.6 — might check their github project…

Tara Hernandez
Senior Engineering Manager
Lithium Technologies
“I’m Hiring!” — http://tinyurl.com/kjju3jc

From: Douglas Garstang <doug.garstang@gmail.commailto:doug.garstang@gmail.com>
Reply-To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Date: Wednesday, November 5, 2014 at 11:46 AM
To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Subject: [chef] Vagrant’s add_role not working.

This may be more of a vagrant question, but, I have this in my Vagrantfile:

config.vm.provision :chef_solo do |chef|
chef.node_name = "test01.slicetest.comhttps://urldefense.proofpoint.com/v2/url?u=http-3A__test01.slicetest.com&d=AAMFaQ&c=d0zfrhNal2R3FglT42otVSsev2iKpEjzd-pzCCcmjmo&r=6sxCYQz0KcVHfa4mxSDZqe1qy3qynIFh2fmWbyKZEtA&m=HxsNPafr9AEiuPbv_A_8KTxdZmgUz1kQznTYqqNNtbI&s=czMuGpT4YyPIyQMrHf5VaTDe7nPUDQ42xlhQYKqF74g&e="
chef.environment = "dev"
chef.cookbooks_path = "…/…/chef-cookbooks"
chef.data_bags_path = "…/…/chef-sauce/data_bags"
chef.environments_path = "…/…/chef-sauce/environments"
chef.roles_path = "…/…/chef-sauce/roles"
chef.add_role (“role-base”)
chef.run_list = [
“recipe[slice-swap::default]”
]
end

The chef.add_role() isn’t working. The roles_path above it is valid. I tried chef.add_role(“bogus”) and there was no error reported. It seems the role just isn’t there. This is vagrant 1.6.5 and chef 11.14.0.alpha.1

Doug

Tara,

Oh, lovely.

I moved the add_role after the chef.run_list. Error changed to:

"Chef::Exceptions::DuplicateRole: Multiple roles of same type found named
role-base"

I then tried the more old fashioned:

chef.run_list = [
    "role[role-base]",
    "recipe[slice-swap::default]"
]

STILL getting ""Chef::Exceptions::DuplicateRole: Multiple roles of same
type found named role-base""

Sigh.

On Wed, Nov 5, 2014 at 11:49 AM, Tara Hernandez tara.hernandez@lithium.com
wrote:

I’m pretty sure I saw somewhere that roles support is broken in vagrant
1.6 — might check their github project…

Tara Hernandez
Senior Engineering Manager
Lithium Technologies
“I’m Hiring!” — http://tinyurl.com/kjju3jc

From: Douglas Garstang doug.garstang@gmail.com
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Wednesday, November 5, 2014 at 11:46 AM
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Vagrant's add_role not working.

This may be more of a vagrant question, but, I have this in my
Vagrantfile:

config.vm.provision :chef_solo do |chef|
chef.node_name = "test01.slicetest.com
https://urldefense.proofpoint.com/v2/url?u=http-3A__test01.slicetest.com&d=AAMFaQ&c=d0zfrhNal2R3FglT42otVSsev2iKpEjzd-pzCCcmjmo&r=6sxCYQz0KcVHfa4mxSDZqe1qy3qynIFh2fmWbyKZEtA&m=HxsNPafr9AEiuPbv_A_8KTxdZmgUz1kQznTYqqNNtbI&s=czMuGpT4YyPIyQMrHf5VaTDe7nPUDQ42xlhQYKqF74g&e=
"
chef.environment = "dev"
chef.cookbooks_path = "../../chef-cookbooks"
chef.data_bags_path = "../../chef-sauce/data_bags"
chef.environments_path = "../../chef-sauce/environments"
chef.roles_path = "../../chef-sauce/roles"
chef.add_role ("role-base")
chef.run_list = [
"recipe[slice-swap::default]"
]
end

The chef.add_role() isn't working. The roles_path above it is valid. I
tried chef.add_role("bogus") and there was no error reported. It seems the
role just isn't there. This is vagrant 1.6.5 and chef 11.14.0.alpha.1

Doug

--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627

What we do instead is just use the run_list, and any attributes we might have put in the role we just shove directly in the Vagrantfile.

“You’re mileage may vary”

Good luck!
-Tara


Tara Hernandez
Senior Engineering Manager
Lithium Technologies
“I’m Hiring!” — http://tinyurl.com/kjju3jc

From: Douglas Garstang <doug.garstang@gmail.commailto:doug.garstang@gmail.com>
Reply-To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Date: Wednesday, November 5, 2014 at 11:59 AM
To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Subject: [chef] Re: Re: Vagrant’s add_role not working.

Tara,

Oh, lovely.

I moved the add_role after the chef.run_list. Error changed to:

“Chef::Exceptions::DuplicateRole: Multiple roles of same type found named role-base”

I then tried the more old fashioned:

chef.run_list = [
    "role[role-base]",
    "recipe[slice-swap::default]"
]

STILL getting ““Chef::Exceptions::DuplicateRole: Multiple roles of same type found named role-base””

Sigh.

On Wed, Nov 5, 2014 at 11:49 AM, Tara Hernandez <tara.hernandez@lithium.commailto:tara.hernandez@lithium.com> wrote:
I’m pretty sure I saw somewhere that roles support is broken in vagrant 1.6 — might check their github project…

Tara Hernandez
Senior Engineering Manager
Lithium Technologies
“I’m Hiring!” — http://tinyurl.com/kjju3jc

From: Douglas Garstang <doug.garstang@gmail.commailto:doug.garstang@gmail.com>
Reply-To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Date: Wednesday, November 5, 2014 at 11:46 AM
To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Subject: [chef] Vagrant’s add_role not working.

This may be more of a vagrant question, but, I have this in my Vagrantfile:

config.vm.provision :chef_solo do |chef|
chef.node_name = "test01.slicetest.comhttps://urldefense.proofpoint.com/v2/url?u=http-3A__test01.slicetest.com&d=AAMFaQ&c=d0zfrhNal2R3FglT42otVSsev2iKpEjzd-pzCCcmjmo&r=6sxCYQz0KcVHfa4mxSDZqe1qy3qynIFh2fmWbyKZEtA&m=HxsNPafr9AEiuPbv_A_8KTxdZmgUz1kQznTYqqNNtbI&s=czMuGpT4YyPIyQMrHf5VaTDe7nPUDQ42xlhQYKqF74g&e="
chef.environment = "dev"
chef.cookbooks_path = "…/…/chef-cookbooks"
chef.data_bags_path = "…/…/chef-sauce/data_bags"
chef.environments_path = "…/…/chef-sauce/environments"
chef.roles_path = "…/…/chef-sauce/roles"
chef.add_role (“role-base”)
chef.run_list = [
“recipe[slice-swap::default]”
]
end

The chef.add_role() isn’t working. The roles_path above it is valid. I tried chef.add_role(“bogus”) and there was no error reported. It seems the role just isn’t there. This is vagrant 1.6.5 and chef 11.14.0.alpha.1

Doug


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.commailto:doug.garstang@gmail.com
Cell: +1-805-340-5627

Tara,

Mileage varies a lot. I don't like that approach. I'd rather have the
recipe use the same source of data for testing with vagrant as when it runs
on the EC2 instance, otherwise I'm not really testing it properly if I'm
copying and pasting attributes into the Vagrantfile.

Doug.

On Wed, Nov 5, 2014 at 12:06 PM, Tara Hernandez tara.hernandez@lithium.com
wrote:

What we do instead is just use the run_list, and any attributes we might
have put in the role we just shove directly in the Vagrantfile.

“You’re mileage may vary”

Good luck!
-Tara

--
Tara Hernandez
Senior Engineering Manager
Lithium Technologies
“I’m Hiring!” — http://tinyurl.com/kjju3jc

From: Douglas Garstang doug.garstang@gmail.com
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Wednesday, November 5, 2014 at 11:59 AM
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Re: Re: Vagrant's add_role not working.

Tara,

Oh, lovely.

I moved the add_role after the chef.run_list. Error changed to:

"Chef::Exceptions::DuplicateRole: Multiple roles of same type found named
role-base"

I then tried the more old fashioned:

chef.run_list = [
    "role[role-base]",
    "recipe[slice-swap::default]"
]

STILL getting ""Chef::Exceptions::DuplicateRole: Multiple roles of same
type found named role-base""

Sigh.

On Wed, Nov 5, 2014 at 11:49 AM, Tara Hernandez <
tara.hernandez@lithium.com> wrote:

I’m pretty sure I saw somewhere that roles support is broken in
vagrant 1.6 — might check their github project…

Tara Hernandez
Senior Engineering Manager
Lithium Technologies
“I’m Hiring!” — http://tinyurl.com/kjju3jc

From: Douglas Garstang doug.garstang@gmail.com
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Wednesday, November 5, 2014 at 11:46 AM
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Vagrant's add_role not working.

This may be more of a vagrant question, but, I have this in my
Vagrantfile:

config.vm.provision :chef_solo do |chef|
chef.node_name = "test01.slicetest.com
https://urldefense.proofpoint.com/v2/url?u=http-3A__test01.slicetest.com&d=AAMFaQ&c=d0zfrhNal2R3FglT42otVSsev2iKpEjzd-pzCCcmjmo&r=6sxCYQz0KcVHfa4mxSDZqe1qy3qynIFh2fmWbyKZEtA&m=HxsNPafr9AEiuPbv_A_8KTxdZmgUz1kQznTYqqNNtbI&s=czMuGpT4YyPIyQMrHf5VaTDe7nPUDQ42xlhQYKqF74g&e=
"
chef.environment = "dev"
chef.cookbooks_path = "../../chef-cookbooks"
chef.data_bags_path = "../../chef-sauce/data_bags"
chef.environments_path = "../../chef-sauce/environments"
chef.roles_path = "../../chef-sauce/roles"
chef.add_role ("role-base")
chef.run_list = [
"recipe[slice-swap::default]"
]
end

The chef.add_role() isn't working. The roles_path above it is valid. I
tried chef.add_role("bogus") and there was no error reported. It seems the
role just isn't there. This is vagrant 1.6.5 and chef 11.14.0.alpha.1

Doug

--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627

--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627

ALTERNATIVELY,

Replace the role with a wrapper-cookbook that contains "include_recipe foo"
for each item in the role.
Then Douglas's suggestion will work (you use recipes, instead of) with your
requirement (works using same logic/source-of-truth as production)

On Wed, Nov 5, 2014 at 12:09 PM, Douglas Garstang doug.garstang@gmail.com
wrote:

Tara,

Mileage varies a lot. I don't like that approach. I'd rather have the
recipe use the same source of data for testing with vagrant as when it runs
on the EC2 instance, otherwise I'm not really testing it properly if I'm
copying and pasting attributes into the Vagrantfile.

Doug.

On Wed, Nov 5, 2014 at 12:06 PM, Tara Hernandez <
tara.hernandez@lithium.com> wrote:

What we do instead is just use the run_list, and any attributes we
might have put in the role we just shove directly in the Vagrantfile.

“You’re mileage may vary”

Good luck!
-Tara

--
Tara Hernandez
Senior Engineering Manager
Lithium Technologies
“I’m Hiring!” — http://tinyurl.com/kjju3jc

From: Douglas Garstang doug.garstang@gmail.com
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Wednesday, November 5, 2014 at 11:59 AM
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Re: Re: Vagrant's add_role not working.

Tara,

Oh, lovely.

I moved the add_role after the chef.run_list. Error changed to:

"Chef::Exceptions::DuplicateRole: Multiple roles of same type found named
role-base"

I then tried the more old fashioned:

chef.run_list = [
    "role[role-base]",
    "recipe[slice-swap::default]"
]

STILL getting ""Chef::Exceptions::DuplicateRole: Multiple roles of same
type found named role-base""

Sigh.

On Wed, Nov 5, 2014 at 11:49 AM, Tara Hernandez <
tara.hernandez@lithium.com> wrote:

I’m pretty sure I saw somewhere that roles support is broken in
vagrant 1.6 — might check their github project…

Tara Hernandez
Senior Engineering Manager
Lithium Technologies
“I’m Hiring!” — http://tinyurl.com/kjju3jc

From: Douglas Garstang doug.garstang@gmail.com
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Wednesday, November 5, 2014 at 11:46 AM
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Vagrant's add_role not working.

This may be more of a vagrant question, but, I have this in my
Vagrantfile:

config.vm.provision :chef_solo do |chef|
chef.node_name = "test01.slicetest.com
https://urldefense.proofpoint.com/v2/url?u=http-3A__test01.slicetest.com&d=AAMFaQ&c=d0zfrhNal2R3FglT42otVSsev2iKpEjzd-pzCCcmjmo&r=6sxCYQz0KcVHfa4mxSDZqe1qy3qynIFh2fmWbyKZEtA&m=HxsNPafr9AEiuPbv_A_8KTxdZmgUz1kQznTYqqNNtbI&s=czMuGpT4YyPIyQMrHf5VaTDe7nPUDQ42xlhQYKqF74g&e=
"
chef.environment = "dev"
chef.cookbooks_path = "../../chef-cookbooks"
chef.data_bags_path = "../../chef-sauce/data_bags"
chef.environments_path = "../../chef-sauce/environments"
chef.roles_path = "../../chef-sauce/roles"
chef.add_role ("role-base")
chef.run_list = [
"recipe[slice-swap::default]"
]
end

The chef.add_role() isn't working. The roles_path above it is valid. I
tried chef.add_role("bogus") and there was no error reported. It seems the
role just isn't there. This is vagrant 1.6.5 and chef 11.14.0.alpha.1

Doug

--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627

--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627

--

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544

sorry, forgot to say, that you would use the "run_list wrapper-cookbook"

On Wed, Nov 5, 2014 at 12:49 PM, Kenneth Barry kbarry@tunein.com wrote:

ALTERNATIVELY,

Replace the role with a wrapper-cookbook that contains "include_recipe
foo" for each item in the role.
Then Douglas's suggestion will work (you use recipes, instead of) with
your requirement (works using same logic/source-of-truth as production)

On Wed, Nov 5, 2014 at 12:09 PM, Douglas Garstang <doug.garstang@gmail.com

wrote:

Tara,

Mileage varies a lot. I don't like that approach. I'd rather have the
recipe use the same source of data for testing with vagrant as when it runs
on the EC2 instance, otherwise I'm not really testing it properly if I'm
copying and pasting attributes into the Vagrantfile.

Doug.

On Wed, Nov 5, 2014 at 12:06 PM, Tara Hernandez <
tara.hernandez@lithium.com> wrote:

What we do instead is just use the run_list, and any attributes we
might have put in the role we just shove directly in the Vagrantfile.

“You’re mileage may vary”

Good luck!
-Tara

--
Tara Hernandez
Senior Engineering Manager
Lithium Technologies
“I’m Hiring!” — http://tinyurl.com/kjju3jc

From: Douglas Garstang doug.garstang@gmail.com
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Wednesday, November 5, 2014 at 11:59 AM
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Re: Re: Vagrant's add_role not working.

Tara,

Oh, lovely.

I moved the add_role after the chef.run_list. Error changed to:

"Chef::Exceptions::DuplicateRole: Multiple roles of same type found
named role-base"

I then tried the more old fashioned:

chef.run_list = [
    "role[role-base]",
    "recipe[slice-swap::default]"
]

STILL getting ""Chef::Exceptions::DuplicateRole: Multiple roles of same
type found named role-base""

Sigh.

On Wed, Nov 5, 2014 at 11:49 AM, Tara Hernandez <
tara.hernandez@lithium.com> wrote:

I’m pretty sure I saw somewhere that roles support is broken in
vagrant 1.6 — might check their github project…

Tara Hernandez
Senior Engineering Manager
Lithium Technologies
“I’m Hiring!” — http://tinyurl.com/kjju3jc

From: Douglas Garstang doug.garstang@gmail.com
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Wednesday, November 5, 2014 at 11:46 AM
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Vagrant's add_role not working.

This may be more of a vagrant question, but, I have this in my
Vagrantfile:

config.vm.provision :chef_solo do |chef|
chef.node_name = "test01.slicetest.com
https://urldefense.proofpoint.com/v2/url?u=http-3A__test01.slicetest.com&d=AAMFaQ&c=d0zfrhNal2R3FglT42otVSsev2iKpEjzd-pzCCcmjmo&r=6sxCYQz0KcVHfa4mxSDZqe1qy3qynIFh2fmWbyKZEtA&m=HxsNPafr9AEiuPbv_A_8KTxdZmgUz1kQznTYqqNNtbI&s=czMuGpT4YyPIyQMrHf5VaTDe7nPUDQ42xlhQYKqF74g&e=
"
chef.environment = "dev"
chef.cookbooks_path = "../../chef-cookbooks"
chef.data_bags_path = "../../chef-sauce/data_bags"
chef.environments_path = "../../chef-sauce/environments"
chef.roles_path = "../../chef-sauce/roles"
chef.add_role ("role-base")
chef.run_list = [
"recipe[slice-swap::default]"
]
end

The chef.add_role() isn't working. The roles_path above it is valid. I
tried chef.add_role("bogus") and there was no error reported. It seems the
role just isn't there. This is vagrant 1.6.5 and chef 11.14.0.alpha.1

Doug

--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627

--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627

--

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544
www.tunein.com

--

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544