Skip to content

Instantly share code, notes, and snippets.

@changbowen
Last active September 11, 2019 07:42
Show Gist options
  • Select an option

  • Save changbowen/c824bc257287cfb8c4f7e69d1f01c3bb to your computer and use it in GitHub Desktop.

Select an option

Save changbowen/c824bc257287cfb8c4f7e69d1f01c3bb to your computer and use it in GitHub Desktop.
VS Code Ansible snippets
{
"Insert new variable": {
"prefix": ": ",
"body": [
": \"{{ ${2:value} }}\"$0"
],
"description": "Insert new ansible variable"
},
"Insert conditional list": {
"prefix": "cond",
"body": [
"",
"\t\"{{ '[' +",
"\t\t(('\\\"' + ${1:variable1} + '\\\",') if (${1:variable1} | d('',true) | length > 0) else '') +",
"\t\t(('\\\"' + ${2:variable2} + '\\\",') if (${2:variable2} | d('',true) | length > 0) else '') +",
"\t']' }}\"$0"
],
"description": "Insert conditional list"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment