ansible / eda-server

Event Driven Ansible for AAP
Apache License 2.0
66 stars 42 forks source link

unable to create local directories (/.ansible/tmp) in okd #965

Closed zargha closed 4 weeks ago

zargha commented 2 months ago

Please confirm the following

Bug Summary

Currently our github enterprise repository cannot sync with eda-server. The error we get is: Failed to clone the project: ERROR: Unable to create local directories(/.ansible/tmp): [Errno 13] Permission denied: b'/.ansible'

Environment

eda-server is deployed using eda-server-operator on okd cluster (OpenShift version 4.15.0-0.okd-2024-03-10-010116) which is running in vmware.

Steps to reproduce

See environment. Create source control credentials first and then source control github repository.

Actual results

eda server cannot sync the github repository. Error: Failed to clone the project: ERROR: Unable to create local directories(/.ansible/tmp): [Errno 13] Permission denied: b'/.ansible

Expected results

eda-server should be able to sync with the github repo.

Additional information

This seems to be related to the container security context in openshift environment where container is not able to create local directories(/.ansible/tmp). Is there some way to fix this?

   securityContext:
      allowPrivilegeEscalation: false
      capabilities:
        drop:
        - ALL
      runAsNonRoot: true
      runAsUser: 1000490000
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /var/lib/eda/files
      name: eda-server-media-data
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: kube-api-access-9gvrx
      readOnly: true
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  nodeName: tst-okd-6.<>.<>
  preemptionPolicy: PreemptLowerPriority
  priority: 0
  restartPolicy: Always
  schedulerName: default-scheduler
  securityContext:
    fsGroup: 1000490000
    seLinuxOptions:
      level: s0:c22,c14
    seccompProfile:
      type: RuntimeDefault
bzwei commented 4 weeks ago

It is fixed by https://github.com/ansible/eda-server/pull/979