[ansible-project] results from a multi-item Ansible task lacks the 'stdout_lines' attribute in the returned data structure

2014-02-20 Thread Roman Revyakin
Hi Michael, One of the pain points for us often times is the Ansible lack of the human-readable representability of the output of the task that has been run. A workaround up to now has been to use the `debug: var=output.stdout_lines` which while not perfect is at least more bearable in terms t

[ansible-project] Re: results from a multi-item Ansible task lacks the 'stdout_lines' attribute in the returned data structure

2014-02-20 Thread Roman Revyakin
sks; ls", "module_name": "shell" }, "item": "cd tasks; ls", "rc": 0, "start": "2014-02-21 08:30:31.996872", "stderr&quo

Re: [ansible-project] Re: results from a multi-item Ansible task lacks the 'stdout_lines' attribute in the returned data structure

2014-02-20 Thread Roman Revyakin
t is true of the original. > > > On Thu, Feb 20, 2014 at 4:51 PM, Roman Revyakin > wrote: > >> Sorry, posted wrong output for the multi-item task (too early in the >> morning I guess :-). Here's the evidence the multi-item 'results' return >> data structur

Re: [ansible-project] Re: results from a multi-item Ansible task lacks the 'stdout_lines' attribute in the returned data structure

2014-02-20 Thread Roman Revyakin
Hey Brian, Could you please provide an example (say based on the tasks I've posted earlier in my post), as I could not make use of those filters in 'debug' task. Thank you! On Fri, Feb 21, 2014 at 12:24 PM, Brian Coca wrote: > you have |pprint and |to_nice_json filters to make the output 'hu

Re: [ansible-project] Re: results from a multi-item Ansible task lacks the 'stdout_lines' attribute in the returned data structure

2014-02-20 Thread Roman Revyakin
Hey Brian, I do not think that the pprint filter on a multi-item task make the output any readable. Based on my previous example, if I do - name: post-deployment tasks executed local_action: shell {{ item }} with_items: cf_post_deployment_tasks when: cf_post_deployment_tasks is defined re

[ansible-project] Mind-boggling variable expansion in problems in 'lookup'

2013-12-11 Thread Roman Revyakin
Hi guys, Can anyone tell me why variables in this simple playbook do not get expanded? --- - hosts: all gather_facts: false user: ubuntu vars: tokens_file: /tmp/tokens.yml tasks: - debug: msg="{{ lookup('file', '{{ tokens_file }}' ) }}" All I get is $ ansible-playbook -i h

Re: [ansible-project] Mind-boggling variable expansion in problems in 'lookup'

2013-12-11 Thread Roman Revyakin
urlencode }} > > Save that variable and then it looks much much cleaner! > > {{ lookup('file', my_path) }} > > I would also define a variable for the URL so your playbooks can be > cleaner. > > Also, in the future please report what Ansible version y

[ansible-project] How to use the JSON part of an HTTP response in the subsequent tasks?

2013-12-17 Thread Roman Revyakin
Hi guys, I am facing the problem of not being able to use the JSON part of the HTTP response in my subsequent tasks in an Ansible playbook. Here are the relevant tasks from the playbook: - name: Login to account as the specified user and obtain its id local_action: > uri url='http:/

[ansible-project] Re: How to use the JSON part of an HTTP response in the subsequent tasks?

2013-12-17 Thread Roman Revyakin
uot;$content_type_header" ... On Wednesday, December 18, 2013 2:20:22 PM UTC+11, Roman Revyakin wrote: > > Hi guys, > > I am facing the problem of not being able to use the JSON part of the HTTP > response in my subsequent tasks in an Ansible playbook. Here are the > re

Re: [ansible-project] Re: How to use the JSON part of an HTTP response in the subsequent tasks?

2013-12-18 Thread Roman Revyakin
back unicode shouldn't be a problem. > > Possible point of confusion -- What you print from "debug: var" is > actually a Python datastructure, not JSON per se. The 'json' structure > you get back is the datastructure itself that came from the JSON. > &g

Re: [ansible-project] Re: How to use the JSON part of an HTTP response in the subsequent tasks?

2013-12-18 Thread Roman Revyakin
i -f -H "content-type: application/json" -H 'user: {{ usp_user.content | replace("\n", "") }}' -XPUT http://{{ config_manager }}.{{ target_domain }}/archive/settings Regards, Roman On Thursday, December 19, 2013 12:33:10 PM UTC+11, Roman Revyakin wrote: >

Re: [ansible-project] Re: How to use the JSON part of an HTTP response in the subsequent tasks?

2013-12-18 Thread Roman Revyakin
: Archive previous top-level settings config > local_action: > >command curl -i -f -H "content-type: application/json" -H 'user: {{ > usp_user.content | replace("\n", "") }}' -XPUT http://{{ config_manager > }}.{{ target_domain

Re: [ansible-project] Re: How to use the JSON part of an HTTP response in the subsequent tasks?

2014-01-29 Thread Roman Revyakin
ot;application/json" HEADER_user='{{ usp_user.content | replace("\n", "") }}' `usp_user.content` contains the same JSON structure as `usp_user.json`, only it has got the newlines that I need to remove using the `replace` Jinja2 filter. Regards, Roman On Thursda

[ansible-project] Conditionals - when: and is defined works in a weird way

2014-02-03 Thread Roman Revyakin
Hi, I am not sure whether someone has come across this issue previously - trying to search the group for 'when' and 'is defined' did not yield me anything useful. So I am posting it as a new topic here. I have encountered that in case I use 'when:' clause where I need to test whether one variab

[ansible-project] Re: Conditionals - when: and is defined works in a weird way

2014-02-03 Thread Roman Revyakin
Forgot to mention that I use ansible-playbook 1.5 (devel 27199dc219) last updated 2013/12/04 20:39:15 (GMT +1100) On Tuesday, February 4, 2014 11:32:14 AM UTC+11, Roman Revyakin wrote: > > Hi, > > I am not sure whether someone has come across this issue previously - > tryin

Re: [ansible-project] Conditionals - when: and is defined works in a weird way

2014-02-03 Thread Roman Revyakin
r1 conditions would evaluate to true IMHO and the action would be triggered. On Tue, Feb 4, 2014 at 11:38 AM, Adam Heath wrote: > "false" != false. You have a string/boolean issue. Aka, the var1 is not > the boolean value false, but the string value "false". > > >

Re: [ansible-project] Conditionals - when: and is defined works in a weird way

2014-02-03 Thread Roman Revyakin
4 at 1:17 PM, Jesse Keating wrote: > On 2/3/14, 4:32 PM, Roman Revyakin wrote: > >> cat > test_playbook.yaml <> --- >> - hosts: all >>gather_facts: false >> >>tasks: >> - name: Play only if var1 is true and var2 is defined >>

Re: [ansible-project] Re: results from a multi-item Ansible task lacks the 'stdout_lines' attribute in the returned data structure

2015-01-08 Thread Roman Revyakin
readable output. > On Thursday, February 20, 2014 10:48:20 PM UTC+1, Roman Revyakin wrote: >> >> Hi Michael, >> >> One of the pain points for us often times is the Ansible lack of the >> human-readable representability of the output of the task that has been &g

[ansible-project] ec2_lc module does not support VPC?

2014-09-02 Thread Roman Revyakin
Hi guys, It appears that ec2_lc module does not really support creation of launch configurations in VPC? When I provide the name of the security group from a VPC through `security_groups:` option to `ec2_lc` module, I get this error: http://autoscaling.amazonaws.com/doc/2011-01-01/";> Se

[ansible-project] Re: ec2_lc module does not support VPC?

2014-09-02 Thread Roman Revyakin
Ok, I think I found the problem - I supplied the name of the security group instead of its id. On Tuesday, September 2, 2014 7:53:33 PM UTC+10, Roman Revyakin wrote: > > Hi guys, > > It appears that ec2_lc module does not really support creation of launch > configurations