Finally ,,, I got the right combination .. Thaks for all ..
name: List the status of the puppet services
ignore_errors: yes
shell: "{{ item }}"
with_items:
- pp_stat
- pr_date
register: pupstat
- debug:
msg: "{{
Now .. I am able to print the output of items using debug module with
items..
.. but "stdout_lines" is not working ...
-
name: List the status of the puppet services
ignore_errors: yes
shell: "{{ item }}"
with_items:
- "{{ pp_stat }}"
- "{{ pr_date
Now .. I am able to print the output of items using debug module with
items..
.. but "stdout_lines" is not working ...
-
name: List the status of the puppet services
ignore_errors: yes
shell: "{{ item }}"
with_items:
- "{{ pp_stat }}"
- "{{ pr_date
Hi Martz,
I tried with a couple of options as per the link you have shared including
the "shell: echo "{{ item }}" . but still I am unable to combine the
right combination.
my current snippet:
tasks:
- name: List the status of the puppet services
ignore_errors: yes
When running pup_stat alone, it works.
Adding {{ }} around items did not help
On Fri, Aug 2, 2019, 2:40 AM Kai Stian Olstad <
ansible-project+l...@olstad.com> wrote:
> On 01.08.2019 23:05, Veera wrote:
> > Hi,
> >
> > I am trying to call variables to the shell module but failing ..
> >
> >
On 01.08.2019 23:05, Veera wrote:
> Hi,
>
> I am trying to call variables to the shell module but failing ..
>
> - name: status of services
>hosts: myhost
>remote_user: root
>gather_facts: no
>vars:
> - pp_stat: "/etc/init.d/puppet status"
> - pr_date: "echo
When registering a variable with a loop the structure of the data is
different.
Try doing a debug on just `pupstat` to see the data structure. See this
documentation for more information:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html#registering-variables-with-a-loop
Hi,
I am trying to call variables to the shell module but failing ..
- name: status of services
hosts: myhost
remote_user: root
gather_facts: no
vars:
- pp_stat: "/etc/init.d/puppet status"
- pr_date: "echo '= as on date of ==='; date"
strategy: free