How to give attribute like this because i ahve to import values in attribute file?


#1

Kindly help if any one actuaaly pass value like this…according to my problem

dir = '<E:\Program Files\Microsoft> SQL Server’
fdir = '<f:\Program Files\Microsoft> SQL Server’
gdir = ‘<G:\Program Files\Microsoft> SQL Server’

name = node[‘sql_install’][‘instance_name’]
path = "#{dir}\#{name}"
fpath = “#{fdir}\#{name}”

default[‘sql_install’][‘accept_eula’] = true
default[‘sql_install’][‘product_key’] = nil
default[‘sql_install’][‘sql_data_dir’] = "#{path}\DATA"
default[‘sql_install’][‘sql_backup_dir’] = "#{path}\sql_backup"
default[‘sql_install’][‘sql_user_db_dir’] = "#{path}\sql_user_db"
default[‘sql_install’][‘sql_user_db_log_dir’] = “#{fpath}\sqluserlog”


#2

Ankur,

This is the chef-dev mailing list which is for developers of chef code itself, not general questions which should go to the chef mailing list.

It’s unclear what the problem or question is in this case - that code appears mostly valid but the < > characters in the paths are going to give you trouble. While I am not sure if it works for you, there is an existing cookbook that you can use as reference at least that already takes care of installing/configuring SQL Server here.

It seems you’re still dealing with a problem you’ve started a thread on before so I highly suggest you join us in the Community Slack channel where people can help you a bit more realtime instead of starting several threads around the same issue.

Cheers