FAQ
Hey

I've been doing some lookup() local command jank to get the absolute
directory path to my playbook where I store some additional non role
specific config files... plabook_basedir/files/playbookspecific.tar.gz. I
then pass that path in to my various roles that require the centrally
located file. This keeps my playbooks and files nice and tidy and makes
sense in the playbook where I pass the search paths to my roles as
myrole.files : "{{ playbook_dir }}/files" which I then use to add to my
file search path.

I noticed that the inventory_path is absolute so I decided that rather than
continue to use a lookup() to set the playbook base path, this should be
provided by ansible and accurate to the local system path.

My proposed changes:
https://github.com/dingus9/ansible/commit/e9d14cdec5d02282a691d42d370c5b72456b034e If
this seems reasonable I'll create a PR. The code is working, however if
someone could suggest a test to run against playbooks that would help.

--
Nick Shobe

--
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+unsubscribe@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/d21e8b2a-b976-45d6-8030-49f212619f27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Michael DeHaan at Jul 15, 2014 at 12:10 am
    If you'd like to get something reviewed, definitely submit a pull request -
    though I'd like to see this without the extraneous whitespace changes that
    complicate the diff and code attribution.

    My gut feeling is that rather than doing the "x or y", os.path.abspath just
    needs to be called on the path, if defined, because this code seems to
    imply something a bit different.

    I could be wrong though, in skimming, but I don't see where it absoluting
    the path.







    On Mon, Jul 14, 2014 at 7:57 PM, Nick Shobe wrote:

    Hey

    I've been doing some lookup() local command jank to get the absolute
    directory path to my playbook where I store some additional non role
    specific config files... plabook_basedir/files/playbookspecific.tar.gz. I
    then pass that path in to my various roles that require the centrally
    located file. This keeps my playbooks and files nice and tidy and makes
    sense in the playbook where I pass the search paths to my roles as
    myrole.files : "{{ playbook_dir }}/files" which I then use to add to my
    file search path.

    I noticed that the inventory_path is absolute so I decided that rather
    than continue to use a lookup() to set the playbook base path, this should
    be provided by ansible and accurate to the local system path.

    My proposed changes:
    https://github.com/dingus9/ansible/commit/e9d14cdec5d02282a691d42d370c5b72456b034e If
    this seems reasonable I'll create a PR. The code is working, however if
    someone could suggest a test to run against playbooks that would help.

    --
    Nick Shobe

    --
    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+unsubscribe@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/d21e8b2a-b976-45d6-8030-49f212619f27%40googlegroups.com
    <https://groups.google.com/d/msgid/ansible-project/d21e8b2a-b976-45d6-8030-49f212619f27%40googlegroups.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    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+unsubscribe@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/CA%2BnsWgyOU2mcL6267N30UW0sUyM_Xuqc53vXjTwLFNngJkcgFg%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Nick Shobe at Jul 16, 2014 at 3:16 pm
    OK thanks, I updated and submitted a PR. Code is a little cleaner and
    should do what I need.

    https://github.com/ansible/ansible/pull/8165
    On Monday, July 14, 2014 7:10:50 PM UTC-5, Michael DeHaan wrote:

    If you'd like to get something reviewed, definitely submit a pull request
    - though I'd like to see this without the extraneous whitespace changes
    that complicate the diff and code attribution.

    My gut feeling is that rather than doing the "x or y", os.path.abspath
    just needs to be called on the path, if defined, because this code seems to
    imply something a bit different.

    I could be wrong though, in skimming, but I don't see where it absoluting
    the path.








    On Mon, Jul 14, 2014 at 7:57 PM, Nick Shobe <nick...@gmail.com
    <javascript:>> wrote:
    Hey

    I've been doing some lookup() local command jank to get the absolute
    directory path to my playbook where I store some additional non role
    specific config files... plabook_basedir/files/playbookspecific.tar.gz. I
    then pass that path in to my various roles that require the centrally
    located file. This keeps my playbooks and files nice and tidy and makes
    sense in the playbook where I pass the search paths to my roles as
    myrole.files : "{{ playbook_dir }}/files" which I then use to add to my
    file search path.

    I noticed that the inventory_path is absolute so I decided that rather
    than continue to use a lookup() to set the playbook base path, this should
    be provided by ansible and accurate to the local system path.

    My proposed changes:
    https://github.com/dingus9/ansible/commit/e9d14cdec5d02282a691d42d370c5b72456b034e If
    this seems reasonable I'll create a PR. The code is working, however if
    someone could suggest a test to run against playbooks that would help.

    --
    Nick Shobe

    --
    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 <javascript:>.
    To post to this group, send email to ansible...@googlegroups.com
    <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/d21e8b2a-b976-45d6-8030-49f212619f27%40googlegroups.com
    <https://groups.google.com/d/msgid/ansible-project/d21e8b2a-b976-45d6-8030-49f212619f27%40googlegroups.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    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+unsubscribe@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/4915f382-7629-4d84-95e7-a17b6d73a4c9%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupansible-project @
postedJul 15, '14 at 12:08a
activeJul 16, '14 at 3:16p
posts3
users2

2 users in discussion

Nick Shobe: 2 posts Michael DeHaan: 1 post

People

Translate

site design / logo © 2022 Grokbase