Skip to content

Instantly share code, notes, and snippets.

@imax9000
Created July 2, 2017 15:37
Show Gist options
  • Save imax9000/72badd30384149ac41cae2127fcb5bec to your computer and use it in GitHub Desktop.
Save imax9000/72badd30384149ac41cae2127fcb5bec to your computer and use it in GitHub Desktop.
How to break Ansible
% ansible-playbook test.yml
[WARNING]: Host file not found: .../homebrew/etc/ansible/hosts
[WARNING]: provided hosts list is empty, only localhost is available
PLAY [Fuck this shit] **********************************************************
TASK [setup] *******************************************************************
ok: [localhost]
TASK [command] *****************************************************************
changed: [localhost]
TASK [debug] *******************************************************************
fatal: [localhost]: FAILED! => {"failed": true, "msg": "{u'cmd': u\"echo '{{}}' > /dev/null\", u'end': u'2017-07-02 16:35:55.922241', u'stdout': u'', u'changed': True, u'start': u'2017-07-02 16:35:55.914838', u'delta': u'0:00:00.007403', u'stderr': u'', u'rc': 0, 'stdout_lines': [], u'warnings': []}: template error while templating string: Expected an expression, got 'end of print statement'. String: echo '{{}}' > /dev/null"}
to retry, use: --limit @.../test.retry
PLAY RECAP *********************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=1
- name: Fuck this shit
hosts: localhost
tasks:
- shell: echo '{{"{{}}"}}' > /dev/null
register: foo
- debug: msg="{{ foo.stdout }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment