On Thu, 3 Oct 2019 05:48:04 -0700 (PDT) Mohtashim S <mohtash...@gmail.com> wrote:
> - name: Play 4 > hosts: localhost > tasks: > - name: "Load Deployment1." > tags: deploy > include_vars: > file: "{{ item }}" > with_fileglob: > - "vars/App_*.yaml" > > tasks: > - name: "Load Deployment2." > local_action: command ls -ltr checkrun.yml > > [WARNING]: While constructing a mapping from > > /app/axmw/Ansible/playbook/finacle_deployment/checkrun.yml, line 1, column > > 3, found a duplicate dict key > > (tasks). Using last defined value only. > > How can I change my playbook code so that both the tasks can get executed ? > Can't we have multiple tasks under one play ? No. One play can't have 2 "tasks:" directives. Put "hosts:" directive infront of the "tasks:" - name: Play 4 hosts: localhost tasks: - name: "Load Deployment1." ... - name: Play 4 continue hosts: localhost tasks: - name: "Load Deployment2." ... Cheers, -vlado -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/20191003154016.221b04b0%40gmail.com.
pgp0Db4V7Mpr9.pgp
Description: OpenPGP digital signature