Apologies for more than one question in one day but I am really stuck on this one.
I am working on a chef provisioning script that sets up a subnet and then creates a machine in it.
I want to do something like this to tell chef to provision the machine in the subnet it has just created. I need to delay querying the data bag until converge time, but I can't figure out how to do it.
with_machine_options :bootstrap_options => {
:key_name => 'xxxx',
:instance_type => 't1.micro',
:subnet => data_bag_item("aws_subnet", "subnet-a")["subnet_id"],
:associate_public_ip_address => true
}
I have a similar problem later when I need to pass an IP address from one machine to another, and I need the 'attribute' to be evaluated at converge time:
machine 'db' do
run_list ['apt','automateinsights::db']
end
machine 'appserver' do
run_list ['automateinsights::deploy_from_package']
attribute ['automateinsights', 'envconfig', 'db_location'], need db ipaddress here
end