# This file was generated by Chef for <%= node.name %>
# Do NOT modify this file by hand.
# Created by the rackspace_cloudbackup cookbook
<%# Not using YAML.dump as drawing the content directly lets us stick in comments. -%>

authentication:
  apikey: <%= @api_key %>
  apiuser: <%= @api_username %>
  
general:
  configRevision: 2
  region: <%= @api_region %>

locations:
  ---
<%
@backup_config.each do |backup|
  # This is called here to poll the API on template generation during convergance
  # As the ID will be created when the HWRP creates the API object
  api_id = Opscode::Rackspace::CloudBackup::RcbuBackupWrapper.new(@api_username, @api_key, @api_region, backup['label']).backup_id
  raise "ERROR: nil api_id for #{backup['label']}" if api_id.nil?
-%>
  - <%= backup['location'] %>:
    # Chef label: <%= backup['label'] %>
<% if backup['comment'] -%>
    # <%= backup['comment'] %>
<% end -%>
    backupConfigurationId: <%= api_id %>
    enabled: <%= backup['enabled'] %>
<% end -%>

# This file was generated by Chef for <%= node.name %>
# Do NOT modify this file by hand.
# Created by the rackspace_cloudbackup cookbook
<%# Not using YAML.dump as drawing the content directly lets us stick in comments. -%>

authentication:
  apikey: <%= @api_key %>
  apiuser: <%= @api_username %>
  
general:
  configRevision: 2
  region: <%= @api_region %>

locations:
<%
@backup_config.each do |backup|
  # This is called here to poll the API on template generation during convergance
  # As the ID will be created when the HWRP creates the API object
  api_id = Opscode::Rackspace::CloudBackup::RcbuBackupWrapper.new(@api_username, @api_key, @api_region, backup['label']).backup_id
  raise "ERROR: nil api_id for #{backup['label']}" if api_id.nil?
-%>
  - <%= backup['location'] %>:
    # Chef label: <%= backup['label'] %>
<% if backup['comment'] -%>
    # <%= backup['comment'] %>
<% end -%>
    backupConfigurationId: <%= api_id %>
    enabled: <%= backup['enabled'] %>
<% end -%>

Fix YAML error in run_backup config
Fix YAML error in run_backup config
