SOLVED: So I tried extracting the code that I'm having trouble with into a 
separate playbook and then everything started to work, I then removed all 
the debug messages, and slowly added in the rest of what I needed the 
playbook to do and now it all works totally fine!!!!!


On Tuesday, 11 September 2018 11:55:20 UTC+1, Maria MacCallum wrote:
>
> I've tried pre-defining an empty group and not defining, neither seems to 
> work, the group seems to remain empty when I try to use it, I'm sure I'm 
> missing something vital out.
>
> This is an extract:
>
> - hosts: all-t4
>   # need serial 1 to be able t use add_host more than once
>   serial: 1
>   remote_user: XXXX
>   tasks:
>      - name: gather ldom info
>       shell: /usr/sbin/ldm ls -p |awk -F'=' '/active/ {print $2}' | awk 
> -F'|' '{print $1}' |grep -v primary | sed -e 's/iodomain/{{ 
> inventory_hostname }}-io/'
>       register: output
>      - name: add ldom to in-mem inventory
>       add_host:
>         name: "{{ item }}"
>         groups: ldoms
>       with_items: "{{ output.stdout_lines }}"
>     - debug:
>         msg: "{{ group_names }}"
>       with_items: "{{ output.stdout_lines }}"
> - hosts: all
>   tasks:
>    - debug: var="{{ group_names }}"
>

-- 
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/4e69c57a-bbe0-47c0-b36f-e022b7b4e390%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to