Skip to content

Instantly share code, notes, and snippets.

@pcn
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcn/61d28c6a2b207c7c690f to your computer and use it in GitHub Desktop.
Save pcn/61d28c6a2b207c7c690f to your computer and use it in GitHub Desktop.
Salt-ssh with the ec2 contrib grain - trying to render grain data

Trying to get the grain info into a file on the disk of the target system (good IMO for the repetetive style of debugging runs):

[CRITICAL] Rendering SLS 'base:cassandra.raid' failed: Unknown yaml render error; line 7

---
[...]
# as an option, too.
/tmp/disks:
  file.append:
    - text: |
      {'ami': 'sda1', 'root': '/dev/sda1', 'ephemeral0': 'sdb'}
    <======================
---
peter.norton-generic-vagrant:
    - Rendering SLS 'base:cassandra.raid' failed: Unknown yaml render error; line 7
    -
    - ---
    - [...]
    - # as an option, too.
    - /tmp/disks:
    -   file.append:
    -     - text: |
    -       {'ami': 'sda1', 'root': '/dev/sda1', 'ephemeral0': 'sdb'}
    -     <======================
    - ---
The state that's causing this is really simple:
# This recipe could be invoked selecively via targeting at the top
# as an option, too.
{% set ec2 =  salt['grains.get']('ec2') -%}

/tmp/disks:
  file.append:
    - text: |
      {{ ec2.block_device_mapping }}

The run is invoked via salt-ssh:

salt-ssh -l info host -i --roster-file host-roster --priv key state.sls cassandra.raid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment