One of our app uses gunicorn and is configured via a chef cookbook.
The cookbook has some attributes, one of them is the gunicorn version:
grep 'version' attributes/default.rb
default['myapp']['gunicorn']['version'] = '19.1.1'
I want to use version 19.3.0
only if a node is part of a specific role. I created a role and gave it an attribute:
cat ../../roles/gunicorn-19.3.0.rb
name 'gunicorn-19.3.0'
default_attributes(
'mcnulty' => {
'gunicorn' => {
'version' => '19.3.0'
}
}
)
Given that roles attribute get precedence over cookbook attributes, this should work. right??
Now I'd like to test that with kitchen. In our kichen.yml
we already have a default
suite, I copied and created a gunicorn-19.3.0
suite:
- name: gunicorn-19.3.0
roles_path: '../../roles'
run_list:
- recipe[apt]
- recipe[build-essential]
- recipe[myapp]
attributes: &attributes
myapp:
gunicorn:
query:
timeout: 5
workers: 2
sockdir: /var/run/myapp
web:
timeout: 5
workers: 2
sockdir: /var/run/myapp
Now I cannot figure out how to mimic the fact this host is part of the gunicorn-19.3.0
role...
Any help is appreciated.
Best.