The following blueprints are used for day-n operations, such as updating existing blueprints, and creating and initiating workflows.
Update the blueprint file
The following is an example blueprint for updating an existing blueprint with a new operation. In this example, it is adding an operation that is called setBIOS
. This sample is in a YAML format.
tosca_definitions_version: cloudify_dsl_1_3
description: >
Deploys a Compute controlled by DTIAS BMC
imports:
- http://fileserver-svc/data/.artifacts/types/types-6.3.0.yaml
- plugin:dell-imgr-plugin
- plugin:cloudify-ansible-plugin
inputs:
# Base Resource attributes
imgr_svc_url:
type: string
description: Infra Mgr Svc URL
default: flcm-imgr-svc:8090
name:
type: string
description: Compute name
description:
type: string
description: Compute description
resource_type_did:
type: string
description: Resource Type Deployment Id
resource_pool_did:
type: string
description: Resource Pool Deployment Id
global_asset_id:
type: string
description: Global Asset Id
public:
type: string
description: Is it public or not
astate:
type: string
description: Admin state
opstate:
type: string
description: Operational state
ustate:
type: string
description: Usage state
labels:
description: Labels
default: []
# Compute specific attributes
resource_attributes:
description: Resource Attributes
site_did:
type: string
description: BMO Site Deployment Id
node_templates:
bmo:
type: cloudify.nodes.SharedResource
properties:
resource_config:
deployment:
id: { get_capability: [ { get_input: site_did }, bmo_did ] }
rt:
type: cloudify.nodes.SharedResource
properties:
resource_config:
deployment:
id: { get_input: resource_type_did }
rp:
type: cloudify.nodes.SharedResource
properties:
resource_config:
deployment:
id: { get_input: resource_pool_did }
site:
type: cloudify.nodes.SharedResource
properties:
resource_config:
deployment:
id: { get_input: site_did }
compute:
type: dell.nodes.imgr.bmo.resource.Compute
interfaces:
cloudify.interfaces.lifecycle:
setBIOS:
implementation: ansible.cloudify_ansible.tasks.run
inputs:
site_yaml_path: playbook/set-BIOS.yaml
ansible_env_vars:
ANSIBLE_FACT_PATH: /tmp/facts.d
sources:
all:
hosts:
localhost:
ansible_connection: local
run_data:
ip_address: { get_input: ['resource_attributes', 'lom', 'bmc_endpoint'] }
username: { get_secret: ['compute_mgmt_server', 'bmc_username'] }
password: { get_secret: ['compute_mgmt_server', 'bmc_password'] }
properties:
imgr_api:
url: { get_input: imgr_svc_url }
bmo_api: { get_capability: [ get_capability: [ { get_input: site_did }, bmo_did ], bmo_config ]}
# Base Resource
name: { get_input: name }
description: { get_input: description }
resource_type_id: { get_capability: [ { get_input: resource_type_did }, rt_id ] }
rp_id: { get_capability: [ { get_input: resource_pool_did }, rp_id ] }
site_id: { get_capability: [ { get_input: site_did }, site_id ] }
global_asset_id: { get_input: global_asset_id }
public: { get_input: public }
astate: { get_input: astate }
opstate: { get_input: opstate }
ustate: { get_input: ustate }
labels: { get_input: labels }
# Compute Attributes
resource_attributes: { get_input: resource_attributes }
relationships:
- type: dell.relationships.depends_on_shared_resource
target: rt
- type: dell.relationships.depends_on_shared_resource
target: rp
outputs:
rclass:
description: Resource Class
value: COMPUTE
ansible_fact:
value: {get_attribute: [compute, facts, ansible_local, "/tmp/facts.d/custom.fact"]}
capabilities:
Example input
The following is an example of an input file for the blueprint. This sample is in a JSON format.
{
"astate": "UNLOCKED",
"description": "",
"global_asset_id": "server12",
"imgr_svc_url": "flcm-imgr-svc:8090",
"labels": [
{
"ccp_resourcepool_id": "rp_dp"
},
{
"ccp_deployment_type": "Resource"
}
],
"name": "server1",
"opstate": "ENABLED",
"public": "TRUE",
"resource_attributes": {
"compute_config": {
"bmo_server_spec": {
"bmc": [
{
"attributes": null,
"ipmiLanEnable": "Enabled",
"serialRedirectEnable": "Enabled"
}
]
}
},
"location": "gc",
"lom": {
"bmc_cred_secret_name": "compute_mgmt_server",
"bmc_endpoint": "https://10.239.60.12"
}
},
"resource_pool_did": "rp_dp",
"resource_type_did": "rt_compute_dp",
"site_did": "gc-site",
"ustate": "IDLE"
}