Re: [ansible-project] shell module with multiple arguments using variables

2019-08-03 Thread Veera
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: "{{

Re: [ansible-project] shell module with multiple arguments using variables

2019-08-02 Thread Veera
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

Re: [ansible-project] shell module with multiple arguments using variables

2019-08-02 Thread Veera
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

Re: [ansible-project] shell module with multiple arguments using variables

2019-08-02 Thread Veera
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

Re: [ansible-project] shell module with multiple arguments using variables

2019-08-01 Thread Veera Mani
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 .. > > > >

Re: [ansible-project] shell module with multiple arguments using variables

2019-08-01 Thread Kai Stian Olstad
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

Re: [ansible-project] shell module with multiple arguments using variables

2019-08-01 Thread Matt Martz
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

[ansible-project] shell module with multiple arguments using variables

2019-08-01 Thread Veera
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