Hello. I'm trying to send output via debug and hipchat which I want to
appear as multiple lines. But I'm failing. Can anyone advise? In my test
below, I of course want the output to show up like this:
i am a runon sentence
i go on and on
Here is my test play and the results. I'm using ansible 1.8.2.
$ cat q.yml
---
- hosts: 127.0.0.1
connection: local
gather_facts: False
tasks:
- include: "{{ playbook_dir }}/dev/debug_msg.yml"
$ cat dev/debug_msg.yml
---
- hosts: 127.0.0.1
connection: local
gather_facts: False
vars:
my_msg: |
"A - i am a runon sentence
i go on and on and on"
tasks:
- debug: msg={{my_msg}}
- debug: msg="B - i am a runon sentence \n i go on and on and on"
- name: Testify to hipchat
hipchat: token={{ hipchat_token }} from={{ hipchat_user }} room={{
priv_hipchat_room }} msg="C - i am a runon sentence \n i go on and on and
on"
- name: Testify to hipchat again
hipchat: token={{ hipchat_token }} from={{ hipchat_user }} room={{
priv_hipchat_room }} msg={{ my_msg }}
$ ansible-playbook -i inventor.ini q.yml
result
TASK: [debug msg={{my_msg}}]
**************************************************
Tuesday 27 January 2015 19:05:10 +0000 (0:00:00.000) 0:00:00.040
*******
ok: [127.0.0.1] => {
"msg": "A - i am a runon sentence\ni go on and on and on"
}
TASK: [debug msg="B - i am a runon sentence \n i go on and on and on"]
********
Tuesday 27 January 2015 19:05:10 +0000 (0:00:00.005) 0:00:00.045
*******
ok: [127.0.0.1] => {
"msg": "B - i am a runon sentence \\n i go on and on and on"
}
in hipchat:
C - i am a runon sentence \n i go on and on and on
A - i am a runon sentence i go on and on and on
thanks,
kallen
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/69dd5377-531d-4b0a-b31d-b372d24c6c9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.