Cisco Cisco Intelligent Automation for Cloud 4.3.1 Installation Guide

Page of 130
25
 
Configuring Chef for Cisco IAC Integration
Working with Role Attributes Overrides
3.
Go to the Policy tab.
4.
Associate the new role name (that you entered/changed above) with “cisco-cloud-automation.”
Step 3: Discover the New Role in Cisco Prime Service Catalog 
1.
Start Cisco IAC.
2.
Select Setup > Manage Infrastructure.
3.
Select Chef from the left platform elements column.
4.
On the Chef page, click the Discover Chef Roles option. 
5.
Click Submit Order.
Step 4: Verify that the New Role was Successfully Discovered
1.
Select Setup > Manage Infrastructure again.
2.
Select Chef from the left platform elements column.
3.
Review the list of role names and verify that the new role name is in the list and is shown as “Discovered.”
Important
: You do not need to register Cisco.System.Role, because it is only needed by Process Orchestrator. But 
without that role we wouldn’t be able to bootstrap any other registered roles to VMs.
Working with Role Attributes Overrides
Cisco IAC integration with Chef allows node attribute overrides to be configured and exposed to users ordering servers. 
Attributes are exposed to IAC via Data Bags. You need to create a Data Bag for each Role that needs attribute overrides 
with the same name as the corresponding role. In that Data Bag, you must have a Data Bag item, called “default”. 
Note: 
Use the following JSON sample below as an example.
For each attribute you want to expose, you can provide a friendly name, default, description, help text, and most 
importantly a Ruby expression that represents the attribute you will override at runtime. If you provide a 
comma-separated options list, users will have to choose one of the values in the list.
When a node is ordered, a new Data Bag item is created with the name of the node and includes all of the attribute values 
used for the configured node. These override values are injected by the cisco-cloud-automation cookbook before the 
recipes in the role are run.
Role Data Bag Sample JSON
"id": "default", 
"attributes": { 
"customer.name": { 
"display_name": "Customer Name", 
"description": "The customer name", 
"help_text": "Please select a valid customer.",  "options": ”Opscode,Cisco Systems,ACME Bread",  
"data_type": "string", 
"validation": "",  "value": "Opscode",  "required": "yes", 
"expression": "node.normal[:customer][:name]" 
}, 
"customer.greeting": { 
"display_name": "Customer Greeting", 
"description": "Greeting to display to customer.", 
"help_text": "Please select a customer greeting. For example, Hello.", 
"options": "",  "data_type": "string",  "validation": "",  "value": "Hello",  "required": "yes",