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

(Molecule) Find a way to run tests in an unprivileged Docker container #6

Open
Frzk opened this issue Jun 8, 2021 · 1 comment
Open
Labels
enhancement Proposal about an existing feature help wanted Extra attention is needed

Comments

@Frzk
Copy link
Owner

Frzk commented Jun 8, 2021

All my attempts to run tests in an unprivileged container were unsuccessful.
I tried to run with:

capabilities:
  - SYS_ADMIN
  - SYS_TIME
privileged: false

which should be sufficient (?)
But we get this result:

TASK [frzk.chrony : Set up timezone] *******************************************
[WARNING]: timedatectl command was found but not usable: Failed to query
server: Connection timed out . using other method.
fatal: [instance]: FAILED! => changed=false 
  msg: |-
    Error message:
    tried to configure name using a file "/etc/sysconfig/clock", but could not write to it

PLAY RECAP *********************************************************************
instance                   : ok=2    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

CRITICAL Ansible return code was 2, command was: ansible-playbook --diff --inventory /home/runner/.cache/molecule/frzk.chrony/default/inventory --skip-tags molecule-notest,notest /home/runner/work/ansible-role-chrony/ansible-role-chrony/frzk.chrony/molecule/default/converge.yml
WARNING  An error occurred during the test sequence action: 'converge'. Cleaning up.

I sadly don't have time to dive into Docker internals and whatever. So we'll run in privileged mode for now.
Any help appreciated :-)

@Frzk Frzk added enhancement Proposal about an existing feature help wanted Extra attention is needed labels Jun 8, 2021
Frzk added a commit that referenced this issue Jun 8, 2021
@Frzk
Copy link
Owner Author

Frzk commented Jun 8, 2021

Considering https://github.com/Frzk/ansible-role-chrony/runs/2771707126?check_suite_focus=true, it seems like the given capabilities (SYS_ADMIN + SYS_TIME are not enough).

That might be a good lead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Proposal about an existing feature help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant