Created
November 20, 2015 11:39
-
-
Save gjuric/85e853fd1db8263add01 to your computer and use it in GitHub Desktop.
Ansible escaping problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This works when I run it manualy from the shell: | |
/bin/echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '[email protected]', 'pass')" | /usr/bin/graphite-manage shell | |
This is what I tried to do in Ansible: | |
- name: test | |
command: > | |
/bin/echo "from django.contrib.auth.models import User; User.objects.create_superuser('{{graphite_admin_username}}', '{{graphite_admin_email}}', '{{graphite_admin_password}}')" | /usr/bin/graphite-manage shell | |
And this is the output from Ansible: | |
changed: [graphite] => {"changed": true, "cmd": ["/bin/echo", "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '[email protected]', 'password')", "|", "/usr/bin/graphite-manage", "shell"], "delta": "0:00:00.005750", "end": "2015-11-20 06:51:06.479436", "rc": 0, "start": "2015-11-20 06:51:06.473686", "stderr": "", "stdout": "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '[email protected]', 'password') | /usr/bin/graphite-manage shell"} | |
But it does not achieve a desired result. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment