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

[WIP] sysvinit: check service is started when 'reload' is used and service is stopped #55552

Open
wants to merge 3 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@pilou-
Copy link
Contributor

commented Apr 19, 2019

SUMMARY

sysvinit: check service is started when state: reloaded is used and service is stopped

Integration test provided.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

sysvinit

ADDITIONAL INFORMATION

How to reproduce:

$ cat play.yml
- hosts: all
  gather_facts: false
  connection: docker
  tasks:
    - raw: 'DEBIAN_FRONTEND=noninteractive apt-get --assume-yes update'
    - raw: 'DEBIAN_FRONTEND=noninteractive apt-get --assume-yes install python'
    - apt:
        name: openssh-server
    - sysvinit:
        name: ssh
        state: reloaded
$ docker run --rm --name test_sysvinit -d debian:stretch sleep infinity
$ ansible-playbook -i test_sysvinit, play.yml # this command fails
$ docker stop test_sysvinit # cleanup

@pilou- pilou- force-pushed the pilou-:service_reloaded_asked_restart_if_not_started branch from e8d4423 to 973cb74 Apr 19, 2019

@pilou-

This comment has been minimized.

Copy link
Contributor Author

commented Apr 19, 2019

As expected, added test fails (rhel/7.6, rhel/8.0, centos6, centos7, fedora28, fedora29, opensuse15py2, opensuse15, ubuntu1604, ubuntu1804):

02:20 TASK [service : Ensure 'start' is used instead of 'reload'] ********************
02:21 fatal: [testhost]: FAILED! => {"changed": false, "msg": "Failed to reload service: ansible_test_reload", "rc": 1, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

a proposed bugfix will be added.

reloaded: start the service if not already started
as explained in the documentation

@pilou- pilou- force-pushed the pilou-:service_reloaded_asked_restart_if_not_started branch from e3b020b to 864919c Apr 19, 2019

@samdoran samdoran removed the needs_triage label Apr 23, 2019

@ansibot ansibot added the stale_ci label May 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.