Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reboot plugin not working in Illumos/Solaris #48986

Merged
merged 1 commit into from
Nov 29, 2018

Conversation

jpdasma
Copy link
Contributor

@jpdasma jpdasma commented Nov 21, 2018

SUMMARY

Using the reboot plugin under OpenIndiana results in the following error:

"msg": "Shutdown command failed. Error was /usr/sbin/shutdown: -r: unknown option\r\nUsage: /usr/sbin/shutdown [ -y ] [ -g ] [ -i ] [ message ], Shared connection to 192.168.122.146 closed.",

The issue is that the command being called is wrong (shutdown -y -g {delay_sec} -r "{message}") for Solaris/Illumos based system.
As specified here https://docs.oracle.com/cd/E23824_01/html/821-1451/gldpm.html and the manpages for OpenIndiana, there is no "-r" argument for shutdown. Also, based on the manpages, -i (init-state) defaults to single user mode, which means that the system would fail to start again.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

reboot.py

ADDITIONAL INFORMATION

By default, there is no whoami installed in OpenIndiana. This would make the DEFAULT_TEST_COMMAND to fail. Should I file an issue for this? Or could I fix this here?

@ansibot
Copy link
Contributor

ansibot commented Nov 21, 2018

Hi @jpdasma, thank you for submitting this pull-request!

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. community_review In order to be merged, this PR must follow the community review workflow. needs_triage Needs a first human triage before being processed. small_patch support:community This issue/PR relates to code supported by the Ansible community. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Nov 21, 2018
@gundalow

This comment has been minimized.

@ansibot

This comment has been minimized.

@gundalow gundalow added support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed support:community This issue/PR relates to code supported by the Ansible community. labels Nov 22, 2018
@ansibot ansibot added support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Nov 22, 2018
@gundalow gundalow added support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed support:community This issue/PR relates to code supported by the Ansible community. labels Nov 22, 2018
@ansibot ansibot added support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Nov 22, 2018
@jpdasma
Copy link
Contributor Author

jpdasma commented Nov 24, 2018

rebased to retrigger build

@jpdasma
Copy link
Contributor Author

jpdasma commented Nov 24, 2018

Error in CI is not related to Solaris/Illumos.

@gundalow gundalow added core_review In order to be merged, this PR must follow the core review workflow. support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Nov 26, 2018
@ansibot ansibot removed the support:community This issue/PR relates to code supported by the Ansible community. label Nov 26, 2018
@samdoran samdoran self-assigned this Nov 27, 2018
@samdoran samdoran added the ci_verified Changes made in this PR are causing tests to fail. label Nov 27, 2018
@samdoran samdoran removed the ci_verified Changes made in this PR are causing tests to fail. label Nov 27, 2018
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Nov 27, 2018
@abadger abadger removed the needs_triage Needs a first human triage before being processed. label Nov 27, 2018
@samdoran
Copy link
Contributor

Thank you for reporting this. I'm curious which version of Solaris this is that doesn't have the -r flag. Can you give me the output of ansible [host] -m setup -a 'filter=ansible_distribution*'?

@jpdasma
Copy link
Contributor Author

jpdasma commented Nov 29, 2018

hi, i tested this on OpenIndiana. I think both should be the same as Solaris 11. (well at least based on Oracle's online man page). I'll deploy later a Solaris 11 VM to verify.

@jpdasma
Copy link
Contributor Author

jpdasma commented Nov 29, 2018

Tribblix (another Illumos distro) also doesn't have a "-r" as flags

@jpdasma
Copy link
Contributor Author

jpdasma commented Nov 29, 2018

Hi, seems I am wrong, Solarias 11 (at least 11.4) as the "-r" flag. For Illumos based, I have verified that OpenIndiana (Hipster 2018.10 version) still doesn't have a "-r" flag. Maybe they stuck with the old shutdown from Solaris 10? (Although I still haven't touch a Solaris 10 box)

Maybe a separate Illumos classification is needed?

@bcoca bcoca merged commit 37f66ee into ansible:devel Nov 29, 2018
@samdoran
Copy link
Contributor

@jpdasma That aligns with my testing on Solaris 10 and Solaris 11. I tested on Solaris 11, but the command you suggest in this PR seems to work for Solaris 10. Can you test with #49272?

I would also appreciate the output of ansible [host] -m setup -a 'filter=ansible_distribution*' on the distributions you mention (OpenIndiana and Tribblix).

@jpdasma
Copy link
Contributor Author

jpdasma commented Nov 30, 2018

Hi, this is my result:

192.168.122.146 | SUCCESS => {
    "ansible_facts": {
        "ansible_distribution": "OpenIndiana"
    },
    "changed": false
}

This is for OpenIndiana, for Tribblix, I don't have access to the machine I tested at the moment.

@samdoran
Copy link
Contributor

That is helpful. Could you add the * to the end so I can see version inforamation as well? Also, how about ansible [host] -m setup -a 'filter=ansible_os_family'?

@jpdasma
Copy link
Contributor Author

jpdasma commented Dec 4, 2018

This is for Tribblix
For ansible_distribution*:

192.168.122.112 | SUCCESS => {
    "ansible_facts": {
        "ansible_distribution": "SunOS", 
        "ansible_distribution_release": "5.11", 
        "ansible_distribution_version": "omnitribblix-m20.5"
    }, 
    "changed": false
}

For ansible_os_familty:

192.168.122.112 | SUCCESS => {
    "ansible_facts": {
        "ansible_os_family": "SunOS"
    }, 
    "changed": false
}

@jpdasma
Copy link
Contributor Author

jpdasma commented Dec 4, 2018

OmniOS and OpenIndiana:

192.168.122.146 | SUCCESS => {
    "ansible_facts": {
        "ansible_distribution": "OpenIndiana",
        "ansible_distribution_release": "OpenIndiana Hipster 2018.10 (powered by illumos)",
        "ansible_distribution_version": "illumos-c540c5554d"
    },
    "changed": false
}
omnios | SUCCESS => {
    "ansible_facts": {
        "ansible_distribution": "OmniOS",
        "ansible_distribution_release": "OmniOS v11 r151028d",
        "ansible_distribution_version": "r151028d"
    },
    "changed": false
}
192.168.122.146 | SUCCESS => {
    "ansible_facts": {
        "ansible_os_family": "Solaris"
    },
    "changed": false
}
omnios | SUCCESS => {
    "ansible_facts": {
        "ansible_os_family": "Solaris"
    },
    "changed": false
}

@samdoran
Copy link
Contributor

samdoran commented Dec 4, 2018

Thank you. This is very helpful.

@samdoran
Copy link
Contributor

samdoran commented Dec 6, 2018

@jpdasma Can you test with #49272? I believe I fixed the lack of whoami in OpenIndiana (and all Solaris versions) with that PR by using who instead. If that's not a universal enough command, feel free to suggest one that's appropriate for Solaris-based distributions. Thank you.

@jpdasma
Copy link
Contributor Author

jpdasma commented Dec 17, 2018

@samdoran working fine on my end thanks!

@dagwieers dagwieers added the solaris Solaris community label Jan 9, 2019
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. small_patch solaris Solaris community support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants