On Sat, Mar 23, 2024 at 9:51 AM Todd Lewis <[email protected]> wrote:
>
> This isn't so much an Ansible question as it is a Git question. But that's
> okay.
>
> The problem you've described is exactly what git submodules are intended to
> address. The problem with submodules is that almost nobody uses them, so
> you'll find very little in the way of support of "the community". If you use
> them, you'll end up being the local expert on them.
>
> Git submodules allow you to embed a git project inside another project. In
> your case, you'll be embedding the project containing the CSV file into
> multiple other git projects. That should be fine as long as you keep things
> up-to-date.
By repository name, not by individual file. It's not necessarily
efficient. It's normally possible to export a file from a git repo as
needed. Take a look at the GUI for your repo and look for the
individual file, and the how do display it "raw" if you're having
trouble exporting it.
> Good luck with that!
> --
> Todd
>
> On 3/22/24 3:18 AM, Thirumalai Raja A wrote:
>
> Hello guys,
>
> below is my playbook, actually i have csv file called subnetsheet in my git
> repo where i have kept my playbook, in my first task i am reading my yaml
> file and then based on the value "location_network" i am reading CSV file and
> get some of the data which was working as i am expected.
>
> here my question is can i keep my CSV file in a different git repo, if yes
> how can i call that csv file from this current repo.
> I am trying to keep a single csv file as I have branches. If I modify the csv
> data in amy of those branch it's getting conflicting so I want to keep a
> single csv file. If anyone has any idea pls help me.
>
> tasks:
> - name: read vm_data
> set_fact:
> vm_data: "{{ lookup('file', 'variables/vm_data.yaml') | from_yaml }}"
> tags:
> - read-vm_data
>
> - name: getting IP_scope
> getip_scope:
> csv_file: template/subnetsheet.csv
> location_network: "{{ location_network }}"
> register: vm_data
> tags:
> - get-ip-sco
>
> regards,
> Thirumalai Raja.
> --
> 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/CALyK%3Dg86kQLgx%3DAPaQ8%2B%3D83n7s5-3mcxOP%2B36%2Bykn18eg%2BUECA%40mail.gmail.com.
>
>
> --
> Todd
>
> --
> 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/95d64764-d9d1-4617-b8a3-a72028e6ee04%40gmail.com.
--
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/CAOCN9rwm8gfHTdDnMA8Y5oS3q8OTy15EsvmvSKOi1X8forn5Eg%40mail.gmail.com.