Thanks for your replies and for taking the time. Adrian, I did not understand what you meant for background when it comes to values being different, I'm sorry. I'm asking now you and Mathias as I'm in the dark here: should I update #22949 <https://github.com/ansible/ansible/pull/22949> with a report of what's been discussed in this thread or should I rebase following ansible guide <http://docs.ansible.com/ansible/latest/dev_guide/developing_rebasing.html>? I'm no developer but I understand the changes stated in PR #22949. I really don't want to screw something up or do something dumb due my lack of experience.
El lunes, 24 de julio de 2017, 12:38:13 (UTC-3), Adrian Likins escribió: > > Analysis sounds correct to me, but would like to clarify the expected > result: > > For a system with /etc/os-release of: > > NAME="Arch Linux" > PRETTY_NAME="Arch Linux" > ID=arch > ID_LIKE=archlinux > ANSI_COLOR="0;36" > HOME_URL="https://www.archlinux.org/" > SUPPORT_URL="https://bbs.archlinux.org/" > BUG_REPORT_URL="https://bugs.archlinux.org/" > > The desired value for 'ansible_os_family' is 'Archlinux' ? > > And for the other distro facts: > > "ansible_distribution": "Archlinux", > "ansible_distribution_file_parsed": true, > "ansible_distribution_file_path": "/etc/os-release", > "ansible_distribution_file_variety": "Archlinux", > "ansible_distribution_major_version": "NA", > "ansible_distribution_release": "NA", > "ansible_distribution_version": "NA", > > > What is the background for the values in /etc/os-release being different > than the desired values ('Arch Linux' vs 'Archlinux') ? > > > The description at > https://github.com/ansible/ansible/pull/15675#issue-151988680 claims: > > "systemd is a first class citizen in Arch Linux variants and thus > /etc/os-release will always have the right info [1]. We don't need to rely > on /etc/arch-release and allowempty workaround." > > Is that correct? > > > If so, sounds like just need to rebase > https://github.com/ansible/ansible/pull/15675 or > https://github.com/ansible/ansible/pull/22949 again. > > On Mon, Jul 24, 2017 at 10:54 AM, Mathias Ettinger <[email protected] > <javascript:>> wrote: > >> I compared the source codes between 2.3 and 2.4, it seems to me that the >> check at >> https://github.com/ansible/ansible/blob/stable-2.3/lib/ansible/module_utils/facts.py#L729-L731 >> >> is not present something like here >> https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/system/distribution.py#L171 >> >> and since no "parse_distribution_file_Archlinux" method is present, it goes >> all the way down to "parse_distribution_file_NA" which just plain reads >> /etc/os-release. >> >> Maybe it's time to implement such method for custom logic, or stick to >> the 'allowempty' trick. >> >> I also tryed manually applying the fix provided in #15675 and got the >> desired output: >> "ansible_distribution": "Archlinux", >> "ansible_distribution_file_parsed": true, >> "ansible_distribution_file_path": "/etc/os-release", >> "ansible_distribution_file_variety": "Archlinux", >> "ansible_distribution_major_version": "NA", >> "ansible_distribution_release": "NA", >> "ansible_distribution_version": "NA", >> >> so maybe just update this PR instead (or #22949) to modify the right file? >> >> >> >> Le lundi 24 juillet 2017 16:28:00 UTC+2, mdl a écrit : >>> >>> I saw this <https://github.com/ansible/ansible/pull/15675> issue at >>> GitHub where people requested to get Archlinux detection from >>> /etc/os-release. It seems to be related to this. What's the best way to >>> address this with the Ansible team? It's not a big issue but having no >>> spaces in distribution or family name is a good practice. >>> >>> Thanks for your help, it's nice to know the root of the 'problem'. >>> >>> El lunes, 24 de julio de 2017, 11:07:14 (UTC-3), Mathias Ettinger >>> escribió: >>>> >>>> Got the same output using ansible 2.4: >>>> "ansible_distribution": "Arch Linux", >>>> "ansible_distribution_file_parsed": true, >>>> "ansible_distribution_file_path": "/etc/os-release", >>>> "ansible_distribution_file_variety": "NA", >>>> "ansible_distribution_major_version": "NA", >>>> "ansible_distribution_release": "NA", >>>> "ansible_distribution_version": "NA", >>>> >>>> the "ansible_distribution_file_path" is new from 2.3 and may be the >>>> source of the infos instead of hardcoded ones, hence "Arch Linux" >>>> >>>> >>>> >>>> Le lundi 24 juillet 2017 15:37:34 UTC+2, mdl a écrit : >>>>> >>>>> Thank you so much for your reply Mathias. >>>>> >>>>> Version: >>>>> me@host ~> ansible --version >>>>> 2 >>>>> ansible 2.4.0 >>>>> config file = /etc/ansible/ansible.cfg >>>>> configured module search path = [u >>>>> '/home/me/.ansible/plugins/modules', u >>>>> '/usr/share/ansible/plugins/modules'] >>>>> ansible python module location = /usr/lib/python2.7/site-packages/ >>>>> ansible >>>>> executable location = /usr/bin/ansible >>>>> python version = 2.7.13 (default, Feb 11 2017, 12:22:40) [GCC 6.3.1 >>>>> 20170109] >>>>> >>>>> I just tried your example playbook in my computer and got: >>>>> me@host ~/Ansible> cat /etc/os-release >>>>> NAME="Arch Linux" >>>>> PRETTY_NAME="Arch Linux" >>>>> ID=arch >>>>> ID_LIKE=archlinux >>>>> ANSI_COLOR="0;36" >>>>> HOME_URL="https://www.archlinux.org/" >>>>> SUPPORT_URL="https://bbs.archlinux.org/" >>>>> BUG_REPORT_URL="https://bugs.archlinux.org/" >>>>> >>>>> me@host ~/Ansible> ansible-playbook arch-test.yml | grep ansible_os >>>>> "ansible_os_family": "Arch Linux", >>>>> "ansible_os_family": "Arch Linux", >>>>> "ansible_os_family": "Arch Linux", >>>>> "ansible_os_family": "Arch Linux", >>>>> >>>>> Is version 2.4.0 to blame here? >>>>> >>>>> El lunes, 24 de julio de 2017, 10:18:13 (UTC-3), Mathias Ettinger >>>>> escribió: >>>>>> >>>>>> Using ansible 2.3.1.0 and the following playbook: >>>>>> >>>>>> - hosts: localhost >>>>>> tasks: >>>>>> - debug: msg={{ vars }} >>>>>> >>>>>> I get, amongst others: "ansible_os_family": "Archlinux", and >>>>>> "ansible_distribution": "Archlinux", >>>>>> >>>>>> What version are you using? >>>>>> >>>>>> >>>>>> Le vendredi 21 juillet 2017 18:32:16 UTC+2, mdl a écrit : >>>>>>> >>>>>>> I'm testing Ansible roles with Archlinux and one of them uses >>>>>>> ansible_os_family to include variables or tasks. So I have: >>>>>>> - name: include OS vars >>>>>>> include_vars: "{{ ansible_os_family }}.yml" >>>>>>> when: ansible_os_family == 'Archlinux' >>>>>>> >>>>>>> Problem is that ansible_os_family gets 'Arch Linux' as value, so >>>>>>> ansible looks for 'Arch Linux.yml' but filename is actually >>>>>>> 'Archlinux.yml', just capital A and no spaces. I know this is not a >>>>>>> fancy >>>>>>> bug or anything, I've been looking at ansible code and GitHub issues >>>>>>> but >>>>>>> only found OS_FAMILY_MAP (Code here >>>>>>> <https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/system/distribution.py>) >>>>>>> >>>>>>> and Arch seems to be defined as 'Archlinux' but never 'Arch Linux'. >>>>>>> >>>>>>> Could anyone guide me because I do not know if something changed >>>>>>> with /etc/os-release in Archlinux or maybe a bug needs to be reported >>>>>>> to >>>>>>> update variables like OS_FAMILY_MAP. >>>>>>> >>>>>>> Thanks in advance. >>>>>>> >>>>>> -- >> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/1d2a2890-2141-4514-a088-aaac97ef26fc%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/1d2a2890-2141-4514-a088-aaac97ef26fc%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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/771c8216-8892-4a8e-9e4e-0af4337ebcc6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
