On Mon, Feb 3, 2020, at 8:56 PM, Cloud09 wrote:
> Hello Team,
> 
> I am writing a playbook to start weblogic servers, could anyone help me 
> any syntax errors, I could not make item/item display as it should be, 
> or please feel free to correct me here if any incorrect syntax and 
> would not work as expected.
> 
> ---
>  - hosts: appservers
> become: yes
> become_user: cloud9
> vars:
> filepath:
>  - "nohup /opt/jpmc/cloud9/stat/wl12213/cloud9/bin"
> stopservers:
>  - "/stop-caServer01.sh"
>  - "/stop-nyServer01.sh"
>  - "/stop-ohServer01.sh"
> tasks:
>  - name: Start the admin server
> command: "{{item}}/startManagedWebLogic.sh"
> loop:
>  - filepath 
>  - name: Start the managed server(s)
> command: "{{item}}/{{item}}"
> loop: 
>  - filepath
>  - stopservers

Instead of loop, I'd recommend with_together.

- name: Start the managed server(s)
 command: "{{item.0}}/{{item.1}}"
 with_together: 
  - "{{filepath}}"
  - "{{stopservers}}"

V/r,
James Cassell

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/80545ac9-2517-41d8-a9cf-96339c5ff105%40www.fastmail.com.

Reply via email to