--
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-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAON3ZR2d9hJ7PHdRW1ToRHQhXL9gm-Qa08aw0jb11vj2vWQH2A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAFwWkHoj%3DVvJgTNzMkZaObw3GuZku1kdGEs-s2Lsi3aR3hauwg%40mail.gmail.com.
Thanks Abhijeet for your helpIs there any way I can move the loop out of the playbook and make it read from the main playbook.These are patch files and will be changing for each patching cycle.Let me know if this is possible.RegardsAmit
---
- name: Download the patches for sage hosts: app vars: my_dest: /busdata/qwm/mna1/geodev12/folders/GX/PATCH/ my_url: https://raw.gitlabusercontent.michelin.com/na-sc/na-log/wms_nca/wms_na_patch/sagepatch/ tasks:
- name: Download files from my_url ansible.builtin.get_url:
url: "{{ my_url }}/{{ item }}" url_username: url_password: dest: "{{ my_dest }}/{{ item }}" register: download until: download is succeeded delay: 3
loop: "{{ lookup('ansible.builtin.file', 'patches.txt') | split('\n') }}"If your "patches.txt" file is part of your source repo anyway, you could list the patches in a "group_vars/app.yml" file and use the containing variable directly. There are lots of other ways to do it as well.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAON3ZR3zT6XQJcxTNYzh16g6cBCcJv6Bn_iNK6pnFn-_LwEcSg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2cdf03dc-9c7d-8af3-36a1-036d1d29f5e7%40gmail.com.
loop: "{{ registered_cat.stdout_lines }}"Each item will then be one line from the file.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/443dca77-9da6-3a6b-a04e-b37b854b927f%40gmail.com.