lobsters / lobsters-ansible

Ansible playbook for lobste.rs
ISC License
79 stars 26 forks source link

systype library vs ansible_os_family #12

Closed jstoja closed 6 years ago

jstoja commented 6 years ago

Any specific reason for using systype as a library for checking the OS family instead of the ansible default ansible_os_family ?

pushcx commented 6 years ago

It's based on a fairly standard one that @alanpost uses at prgmr.com, so perhaps he could chime in. I do know I've already extended it a little (looking up ubuntu release codename for tarsnap).

jstoja commented 6 years ago

Humm, I don't think it's needed since you can have the OS family with ansible_os_family and the codename with ansible_lsb.codename. e.g.:

    - debug: var=ansible_os_family
    - debug: var=ansible_lsb

gives on Ubuntu:

ok: [lobsters.xen.prgmr.com] => {
    "ansible_os_family": "Debian"
}
ok: [lobsters.xen.prgmr.com] => {
    "ansible_lsb": {
        "codename": "xenial",
        "description": "Ubuntu 16.04.3 LTS",
        "id": "Ubuntu",
        "major_release": "16",
        "release": "16.04"
    }
}

and gives on Debian:

ok: [lobsters.xen.prgmr.com] => {
    "ansible_os_family": "Debian"
}
ok: [lobsters.xen.prgmr.com] => {
    "ansible_lsb": {
        "codename": "stretch",
        "description": "Debian GNU/Linux 9.1 (stretch)",
        "id": "Debian",
        "major_release": "9",
        "release": "9.1"
    }
}

If there is no blocking point and @alanpost agrees, I'll make a PR to replace this, since it's the standard way to do it.

jstoja commented 6 years ago

Any chances to have updates on issues and PRs ? :(

alanpost commented 6 years ago

@jstoja That systype library exists, as @pushcx says, because it's the way we do things internally at prgmr.com. The reason we do things the way we do is we need consistent platform naming between ansible, buildbot, and shell/python. We use a single platform detection script everywhere, even if a subsystem like ansible provides it already.

You're correct that in this case that library code is superfluous. I copied our internal stuff out of haste. If you'd like to send a patch to fix it, I'd be happy to give you access to a test system. If you'll send your public key to support@prgmr.com I'll be happy to pull you through accessing the test system as well as powering it up and down. You're also welcome to follow-up with me on freenode, where my nick is alynpost.

jstoja commented 6 years ago

Hey @alanpost thanks a lot for you reply, I removed the usage of it in #16 , but I kept it for now as it might be used for the CI/deployment as you mentioned. As I explained to you on freenode, the test system might be very nice at a later stage, but for now, the Vagrant setup is simpler for both of us.

alanpost commented 6 years ago

If we dropped RedHat/CentOS support as discussed in #27 it would naturally remove any need I had for the systype library.

pushcx commented 6 years ago

Merged #20 for it, added #33 to drop RedHat support.