Skip to content

Conversation

vaygr
Copy link
Contributor

@vaygr vaygr commented Dec 12, 2016

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

lib/ansible/modules/system/service.py

ANSIBLE VERSION

2.2.0.0

SUMMARY

After package management it's the last of 2 main parts of any distro -- an init system.

This adds full support for simpleinit-msb used in Source Mage.

The init system is very simple and unique to Source Mage, based on the Linux Boot Scripts design pattern.

It uses telinit binary to manage init scripts in the system, move them between runlevels, enable/disable, and even install and remove them:

telinit run <script> [<args>]        run init <script> with arguments <args>
telinit switch <rlvl>                switch to runlevel <rlvl>
telinit enable [<script> ... ]       enable and start <script> if not enabled
telinit disable [<script> ... ]      stop and disable <script> if not disabled
telinit bootenable [<script> ... ]   enable <script> if not enabled
telinit bootdisable [<script> ... ]  disable <script> if not disabled
telinit delete [<script> ... ]       delete <script> if disabled
telinit enabled                      list enabled startup scripts
telinit disabled                     list disabled startup scripts
telinit list                         list startup scripts and their runlevels
telinit runlevels                    list all runlevels
telinit runlevel                     print the highest completed runlevel
telinit move <script> <rlvl>         move <script> to runlevel <rlvl>
telinit install <file> <rlvl>        install <file> into runlevel <rlvl>
telinit spellinstall <spell>         install <spell>'s init or xinetd scripts

I've also managed to add some protection for non-existing scripts inside Ansible code.

@bcoca
Copy link
Member

bcoca commented Dec 12, 2016

so the service module is being broken up into component modules in hopes of deprecating it soon, so I am remiss on adding this to it.

I would resubmit as it's own module and also add the init system to fact detection to set the ansible_service_mgr variable.

@bcoca bcoca added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Dec 12, 2016
@vaygr
Copy link
Contributor Author

vaygr commented Dec 12, 2016

I see the point. I just thought it might be less work for initial support, since it's not really that complicated change and most of patterns and code are re-used within the service module. Also it'd be great to see it coming along with sorcery module in 2.3 release.

@ansibot ansibot added affects_2.3 This issue/PR affects Ansible v2.3 module This issue/PR relates to a module. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Dec 13, 2016
@jimi-c jimi-c removed the plugin label Jan 4, 2017
@ansibot ansibot added module_util needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jan 5, 2017
@vaygr vaygr force-pushed the devel-simpleinit-msb branch from 7d8d9c3 to 98c6f06 Compare January 31, 2017 19:04
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI failure due to PEP 8 issue:

2017-01-31 19:29:56 ERROR: PEP 8: lib/ansible/modules/system/service.py:442:161: E501 line too long (161 > 160 characters) (current)

@mattclay mattclay added the ci_verified Changes made in this PR are causing tests to fail. label Feb 1, 2017
@vaygr
Copy link
Contributor Author

vaygr commented Feb 2, 2017

@mattclay thanks, corrected.

@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Feb 2, 2017
@ansibot
Copy link
Contributor

ansibot commented Mar 28, 2017

The test ansible-test sanity --test pep8 failed with the following error:

contrib/inventory/lxd.py:26:29: E231 missing whitespace after ','

click here for bot help

@vaygr
Copy link
Contributor Author

vaygr commented Mar 28, 2017

@bcoca @mattclay is there a chance to ship it with upcoming 2.3?

@vaygr vaygr force-pushed the devel-simpleinit-msb branch from 3a17445 to a830294 Compare March 28, 2017 02:03
@gundalow
Copy link
Contributor

CI was failing due to infrastructure issues bring up MacOS images (unrelated to this change) I've rescheduled the CI

@gundalow
Copy link
Contributor

@vaygr Feature freeze for Ansible 2.3 was a number of weeks ago

@vaygr
Copy link
Contributor Author

vaygr commented Mar 28, 2017

Oh, I'm too late to remind then. Hopefully it'll get its way into 2.4 with above mentioned refactoring or without, because init system support is quite important for full system support.

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 11, 2017
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jun 24, 2017
@vaygr vaygr force-pushed the devel-simpleinit-msb branch from a830294 to 5b5c5af Compare July 30, 2017 14:32
@ansibot ansibot removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Jul 30, 2017
@vaygr
Copy link
Contributor Author

vaygr commented Jul 30, 2017

Bumping for inclusion in 2.4!

@bcoca
Copy link
Member

bcoca commented Jul 31, 2017

@vaygr my initial comment still stands, we are not adding functionality to the existing service module, so this should be submitted as a separate one.

@vaygr
Copy link
Contributor Author

vaygr commented Aug 1, 2017

@bcoca oh, it wasn't clear in your first comment that it's a strict requirement now. I'll see what I can do.

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 14, 2017
@ansibot ansibot added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Nov 2, 2017
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_pull_request labels Mar 2, 2018
@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Sep 18, 2018
@ansibot ansibot removed the support:community This issue/PR relates to code supported by the Ansible community. label Nov 26, 2018
@gundalow
Copy link
Contributor

I'm guessing this should be closed and a new PR raised for the new format?

needs_info

@gundalow gundalow added the candidate_to_close Think we can close this, though need to check with Core label Nov 30, 2018
@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Nov 30, 2018
@ansibot
Copy link
Contributor

ansibot commented Jan 1, 2019

@vaygr This pullrequest is waiting for your response. Please respond or the pullrequest will be closed.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Feb 2, 2019

@vaygr You have not responded to information requests in this pullrequest so we will assume it no longer affects you. If you are still interested in this, please create a new pullrequest with the requested information.

click here for bot help

@ansibot ansibot closed this Feb 2, 2019
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

affects_2.3 This issue/PR affects Ansible v2.3 c:module_utils/facts c:module_utils/ candidate_to_close Think we can close this, though need to check with Core feature This issue/PR relates to a feature request. module_util module This issue/PR relates to a module. needs_info This issue requires further information. Please answer any outstanding questions. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. 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.

7 participants