I'd like to pass configuration file to an instance through metadata. Currently for testing purposes I'm just concatenating text inside the blueprint, like this:
RE_vm:
type: cloudify.openstack.nodes.Server
properties:
resource_id: { concat: ['router_cp_', { get_input: client_name }] }
server:
image: { get_input: re_image }
flavor: { get_input: re_flavor }
key_name: ''
install_agent: false
openstack_config: *openstack_config
interfaces:
cloudify.interfaces.lifecycle:
create:
inputs:
args:
meta:
hostname: { concat: ['vMX-RE-', { get_input: client_name }] }
(...)
files:
"/var/db/configfile": { concat: ["groups {\n
re0 {\n
system {\n
host-name %hostname%;\n
}\n
interfaces {\n
unit 0 {\n
address ", { get_attribute: [left_port, fixed_ip_address] }, "/", { get_input: left_network_mask }, ";\n
}\n
}\n
}\n
global {\n
system {\n
root-authentication {\n
encrypted-password \"", { get_secret: encrypted_password }, "\"; ## SECRET-DATA\n
}\n
}\n
}\n
}\n
"]}
relationships:
- target: mgmt_port
type: cloudify.openstack.server_connected_to_port
But for real-life use, this is not feasible. How can I point to an external file and pass it to the instance?
I haven't found any apparent way of doing that in the documentation.
And preferably I'd like to dynamically fill some variables, based on inputs or some rules (like in Ansible templates). How can I do that with Cloudify?