no, play/roles/includes get compiled into a task list on the 'master',
once this is done each task is individually handled on the target
server, only the task code itself and arguments are copied to the
machine and then executed.

On Sat, Jun 6, 2015 at 1:06 PM,  <zorgg...@gmail.com> wrote:
> Thank you Brian for your explanation. I'm new to Ansible and don't
> understand it perfectly. But it's better now. I use mainly Ansible in
> the"pull" way, but it could be possible the other way round.
>
> What I could do is to use the copy module to copy the Ansible role file into
> a known temp file (/tmp/my_file.yml) of the target, then my Python module
> can access it. At the end of the role, the temp file would be removed.
>
> Thank you all for the time spent explaining me how Ansible works! I thought
> that when a role was executed on a target, the full role directory was
> copied and then vars, templates and files were simply accessible from tasks
> and library.
>
> On Friday, June 5, 2015 at 7:35:55 PM UTC+2, Brian Coca wrote:
>>
>> as i mentioned above, modules execute on the 'target' host and cannot
>> access data on the 'master' themselves (the exception is when both
>> machines are the same, but it has no role/play context at this point).
>>
>> you can either pass the data by using a lookup module that will read
>> the files and make the contents available to the module options ore
>> you need an action_plugin of the same name that can then act on the
>> 'master'. This is how copy works, the action plugin copies the src
>> file to a temporary dir on the target and then runs the copy module
>> feeding it the src= as the temporary file it had copied.
>>
>>
>>
>> On Fri, Jun 5, 2015 at 3:28 AM,  <zorg...@gmail.com> wrote:
>> > The role is updating /etc/group and /etc/gshadow system files from
>> > various
>> > sources, such as ldap and a central file which is now in Ansible. That's
>> > why
>> > I created a role and put all related data into it: "defaults", "files",
>> > "library" and "tasks" directories. Data in "defaults" is read by the
>> > main.yml task, no problem. But there are various files in "files"
>> > directory
>> > that should be chosen then read by the module located in "library".
>> >
>> > On Thursday, June 4, 2015 at 3:16:23 PM UTC+2, Brian Coca wrote:
>> >>
>> >> Hi, it might be easier to use lookup plugins to pass the data to the
>> >> module, I really would need to know what the modules does and how it
>> >> works
>> >> before I can tell you the best approach.
>> >>
>> >> On Thursday, June 4, 2015, <zorg...@gmail.com> wrote:
>> >>>
>> >>> Hi Brian,
>> >>>
>> >>> I've written a Python module in a role using data that I'm going to
>> >>> change from time to time. That's why I wanted to separate the Python
>> >>> code
>> >>> from its data, I manually wrote it in a YAML file. I naively thought
>> >>> the
>> >>> "files" directory of the role would be the best place to keep it, but
>> >>> don't
>> >>> know how to access it from the running Python module.
>> >>>
>> >>> If it's not obvious, maybe I should keep data into the Python code of
>> >>> the
>> >>> module even if I don't feel it very clean (list of 80+
>> >>> dictionaries)...
>> >>>
>> >>>
>> >>
>> >>
>> >> --
>> >> Brian Coca
>> >>
>> > --
>> > 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 post to this group, send email to ansible...@googlegroups.com.
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/ansible-project/3d00e8fb-acce-49a4-85f9-abaaccc49963%40googlegroups.com.
>> >
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Brian Coca
>
> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/9415924c-55ae-4194-864c-5d4ee163ac6b%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Brian Coca

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kr50AmppNpyaN8%3D0UCm2rG2hps62tzGo8OM9PTVMA3RA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to