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

Docker image missing systemctl #13

Open
zoeyronain opened this issue Feb 28, 2019 · 2 comments
Open

Docker image missing systemctl #13

zoeyronain opened this issue Feb 28, 2019 · 2 comments

Comments

@zoeyronain
Copy link

I'm trying to test out an ansible role using your docker image on Travis, however it's unable to enable UFW for the next few steps of the role.

TASK [zoeycluff.betterpress : enable UFW] ************************************** fatal: [localhost]: FAILED! => {"changed": false, "cmd": "/bin/systemctl", "msg": "Failed to connect to bus: No such file or directory", "rc": 1, "stderr": "Failed to connect to bus: No such file or directory\n", "stderr_lines": ["Failed to connect to bus: No such file or directory"], "stdout": "", "stdout_lines": []} [WARNING]: Could not create retry file '/etc/ansible/roles/zoeycluff.betterpress/tests/test.retry'. [Errno 30] Read-only file system: u'/etc/ansible/roles/zoeycluff.betterpress/tests/test.retry'

I changed the init in .travisci to "init: /sbin/init" but it's still trying to use systemctl.

Any idea what else to try? or if possible is there a when statement I can add that disables these steps only in a docker container?

the repo is https://github.com/zoeycluff/ansible-role-betterpress

I appreciate any help!

@zoeyronain
Copy link
Author

zoeyronain commented Feb 28, 2019

#12

Seems like this is related

@dmlb2000
Copy link

@ZoeyCluff it's been a year so not sure if you care anymore. However, for everyone else running ansible inside of a docker container does work better with privileged mode and mounting /sys/fs/cgroup:/sys/fs/cgroup:ro into the container when running.

The alternative is to install a systemctl replacement like https://github.com/gdraheim/docker-systemctl-replacement and you can run docker containers without privileges.

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

No branches or pull requests

2 participants