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

3.18 kernel detection breaks ansible service hooks #1976

Closed
wyaeld opened this issue Oct 15, 2015 · 5 comments · Fixed by #1988
Closed

3.18 kernel detection breaks ansible service hooks #1976

wyaeld opened this issue Oct 15, 2015 · 5 comments · Fixed by #1988
Assignees

Comments

@wyaeld
Copy link

wyaeld commented Oct 15, 2015

a5dda4a by @JohnLZeller appears to be solving a problem related to overlayfs and the kernel.

However not everyone on 3.18 is using overlayfs. This check is creating a new problem.

The ansible-datadog role, https://github.com/DataDog/ansible-datadog uses the ansible core module for service management here https://github.com/DataDog/ansible-datadog/blob/master/tasks/main.yml#L20

This commit breaks it, since the service module expects an output it doesn't get on the info call.

I'm using 14.04.3 LTS Ubuntu, nothing to do with CoreOS and OverlayFS

@JohnLZeller
Copy link
Contributor

@wyaeld thanks for reporting this! We will take a look.

@remh
Copy link

remh commented Oct 19, 2015

@olivielpeau can you take a look please ?

@aster1sk
Copy link

A temporary/hacky solution (I was tasked with a bulk-deployment today) is to modify line 20 here

EC2 AMI :

- shell: chkconfig datadog-agent on
sudo: yes

Debian/Ubuntu :

-shell: update-rc.d datadog-agent defaults
sudo: yes

Also add another block to start the agent :

- shell: service datadog-agent start
sudo: yes
when: datadog_enabled

@remh
Copy link

remh commented Oct 20, 2015

Thanks for the workaround @aster1sk !

olivielpeau added a commit that referenced this issue Oct 20, 2015
The exit code of the `status` command has to be one of 0, 1, 2, 3, 4,
69 to be correctly understood by Ansible, but was returning `253`
when the agent was not running.

Normalize the exit code to 1 to avoid the issue.

See https://github.com/ansible/ansible-modules-core/blob/cbbb20b6bf0d82fdc92f064c9e4d18c04f203da6/system/service.py#L590

Fixes #1976
olivielpeau added a commit that referenced this issue Oct 20, 2015
The exit code of the `status` command has to be one of 0, 1, 2, 3, 4,
69 to be correctly understood by Ansible, but was returning `253`
when the agent was not running on linux kernel versions 3.18+

Normalize the exit code to 1 to avoid the issue.

See https://github.com/ansible/ansible-modules-core/blob/cbbb20b6bf0d82fdc92f064c9e4d18c04f203da6/system/service.py#L590

Fixes #1976
olivielpeau added a commit that referenced this issue Oct 20, 2015
The exit code of the `status` command has to be one of 0, 1, 2, 3, 4,
69 to be correctly understood by Ansible, but was returning `253`
when the agent was not running on linux kernel versions 3.18+

Normalize the exit code to 0 or 1 to avoid the issue.

See https://github.com/ansible/ansible-modules-core/blob/cbbb20b6bf0d82fdc92f064c9e4d18c04f203da6/system/service.py#L590

Fixes #1976
@olivielpeau
Copy link
Member

Found the original cause of the issue (see #1988).

Until the fix is shipped another workaround could be to use the pattern option of the service module by changing https://github.com/DataDog/ansible-datadog/blob/a8398ab8b13069c6dfd91aa658cd06146309a0b7/tasks/main.yml#L20 to:

- service: name=datadog-agent state=started enabled=yes pattern=/opt/datadog-agent/bin/supervisord

urosgruber pushed a commit to urosgruber/dd-agent that referenced this issue Dec 23, 2015
The exit code of the `status` command has to be one of 0, 1, 2, 3, 4,
69 to be correctly understood by Ansible, but was returning `253`
when the agent was not running on linux kernel versions 3.18+

Normalize the exit code to 0 or 1 to avoid the issue.

See https://github.com/ansible/ansible-modules-core/blob/cbbb20b6bf0d82fdc92f064c9e4d18c04f203da6/system/service.py#L590

Fixes DataDog#1976
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants