anish anil
anish anil

Reputation: 2641

How to add a partiular version to the roles file in chef

I have the created a role file with the below contents.

name "Windows_role_150719"
description "Windows_role_150719"

run_list "recipe[deep-sec1]",
"recipe[deep-sec1::install]",
"recipe[deep-sec1::activate]"

override_attributes({
})

The deep-sec1::install & deep-sec1::activate has multiple versions. Like v1, v2, v3, v4, v5

In the roles file how can i specify the version that needs to be installed on the particular node rather than being the latest which is v5.

By default when i upload the role using the "knife role from file command" it takes the latest version and not v2 which i ideally want to apply on the node.

Any help is greatly appreciated

Upvotes: 0

Views: 259

Answers (1)

Mr.
Mr.

Reputation: 10122

specifying (pinning\locking) a cookbook version is done using an environment, and you associate each node with an environment.

when the chef-client run will start on a node, the cookbooks will be synchronized to the node fullfilling the (cookbook) constraints specified in the environment which the node belongs to.

Upvotes: 1

Related Questions