Re: [ansible-project] ERROR! duplicate loop in task: - please explain why

2016-02-04 Thread Steve Kieu
Hi there,

I did use it (quote them and put {{}} around)  but still got errors


TASK [postgres : Install postgres93] 
***
task path: /home/stevek/ansible-jumbo/roles/postgres/tasks/01-install.yml:7
[DEPRECATION WARNING]: Using bare variables for environment is deprecated. 
Update your playbooks so that the environment 
value uses the full variable syntax ('{{foo}}'). This feature will be 
removed in a future release. Deprecation warnings 
can be disabled by setting deprecation_warnings=False in ansible.cfg.
 ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 
test-pg1-all
 EXEC /bin/sh -c 'mkdir -p "$( echo 
$HOME/.ansible/tmp/ansible-tmp-1454651909.82-26088368040824 )" && echo "$( 
echo $HOME/.ansible/tmp/ansible-tmp-1454651909.82-26088368040824 )"'
 PUT /tmp/tmp1tF9fp TO 
/root/.ansible/tmp/ansible-tmp-1454651909.82-26088368040824/yum
fatal: [test-pg1-all]: FAILED! => {"failed": true, "msg": "environment must 
be a dictionary, received proxy_env ()"}


The proxy_env is a dictionary declared in inventory

proxy_env:
  dummy: dummy

So it wont work. How can I make it work then?

Thanks



On Wednesday, January 20, 2016 at 9:58:55 AM UTC+10, Brian Coca wrote:
>
> already gave you the solution: 
>
> environment: "{{proxy_env}}" 
>
> environment won't take bare vars to confuse with strings in 2.0, it 
> will properly validate. 
>
>
>
> -- 
> Brian Coca 
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d8b53f43-320a-47f1-b44f-4a3c74ea1623%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ERROR! duplicate loop in task: - please explain why

2016-01-19 Thread Steve Kieu
Hi Brian,

proxy_env is a dict defined in inventory/group/all  files. I have the code:

- name: Install postgres93
  yum: name={{item}} state=present
  with_items:
- "{{cron_pkgname}}"
- "{{mail_pkgname}}"
- rdiff-backup
- which
- postgresql93-server
- postgresql93-contrib
  environment: proxy_env

that works with version 1.9.x

But v2 refuse to run that code saying expected a dict and got proxy_env. 
When I switch to env: proxy_env it stopped complaining about it. Probably 
it is still error at this but give different error message.

How do I specify proxy_env in v2?  Or is it a bug?




On Wednesday, January 20, 2016 at 2:56:06 AM UTC+10, Brian Coca wrote:
>
> env: proxy_env? 
>
> there is no such directive, i'm guessing you want: 
>
> environment: "{{proxy_env}}" 
>
> 2.0 is now better at validating  playbooks and unlike previous 
> versions it does not ignore incorrect entries. The error message 
> itself seems a bit confusing, but it does point at the correct task. 
>
>
>
> -- 
> Brian Coca 
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6db7fbdf-5c96-4d9a-b89b-5cffd3c0f872%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ERROR! duplicate loop in task: - please explain why

2016-01-19 Thread Brian Coca
already gave you the solution:

environment: "{{proxy_env}}"

environment won't take bare vars to confuse with strings in 2.0, it
will properly validate.



-- 
Brian Coca

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kGH20uQSbYUatXrBL0y3A4aU1a4_VKDPpa1nWLHH-ZLA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ERROR! duplicate loop in task: - please explain why

2016-01-19 Thread Brian Coca
 env: proxy_env?

there is no such directive, i'm guessing you want:

environment: "{{proxy_env}}"

2.0 is now better at validating  playbooks and unlike previous
versions it does not ignore incorrect entries. The error message
itself seems a bit confusing, but it does point at the correct task.



-- 
Brian Coca

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8mx_kyXaBJf1CqAM8Jveuyxr2MTOD5gce4ArrPXGbcnSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ERROR! duplicate loop in task: - please explain why

2016-01-18 Thread Steve Kieu
Hi Team,

I am trying ansible 2 and not sure why it got error below

TASK [postgres : include] 
**
task path: /home/stevek/ansible-jumbo/roles/postgres/tasks/main.yml:10
fatal: [test-pg-all]: FAILED! => {"failed": true, "reason": "ERROR! 
duplicate loop in task: items\n\nThe error appears to have been in 
'/home/stevek/ansible-jumbo/roles/postgres/tasks/01-install.yml': line 7, 
column 3, but may\nbe elsewhere in the file depending on the exact syntax 
problem.\n\nThe offending line appears to be:\n\n\n- name: Install 
postgres93\n  ^ here\n"}

cat /home/stevek/ansible-jumbo/roles/postgres/tasks/01-install.yml
---

- name: Install postgres93
  yum: name={{item}} state=present
  with_items:
- "{{cron_pkgname}}"
- "{{mail_pkgname}}"
- "rdiff-backup"
- "which"
- "postgresql93-server"
- "postgresql93-contrib"
  env: proxy_env

- name: yum clean up cache
  shell: yum clean all; yum clean metadata
  when: do_cleanup == 'yes'

# vim:expandtab ts=2 sw=2

This run perfectly fine with ansible 1.9.x 

Please help.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/91a9cad9-0384-49c9-a5c4-e563e98472b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.