operator-framework / ansible-operator-plugins

Experimental extraction/refactoring of the Operator SDK's ansible operator plugin
Apache License 2.0
7 stars 17 forks source link

How can I change Ansible tmp directory? #42

Closed eli-gc closed 7 months ago

eli-gc commented 7 months ago

Type of question

How to implement a specific feature

Question

What did you do?

I am trying to change the tmp directory which is currently set to /opt/ansible/.ansible/tmp so that I can enable read only root filesystem. I would like to change this to a directory that I am mounting to an emptyDir. I tried to set the ANSIBLE_REMOTE_TMP and DEFAULT_LOCAL_TMP environment variables in my container but I am still getting errors writing to /opt/ansible/.ansible/tmp

What did you expect to see?

I want it so that ansible writes to something like /tmp instead of /opt/ansible/.ansible/tmp given that I mounted /tmp to an emptyDir

What did you see instead? Under which circumstances?

I see that it is still writing to /opt/ansible/.ansible/tmp which resides on the root filesystem

Environment

Operator type:

language helm I think it is helm, but I am not sure. I am actually trying to deploy Kiali-Operator using a helm chart. I am not familiar with how Kiali-Operator uses Ansible. Kubernetes cluster type:

Azure $ operator-sdk version

$ go version (if language is Go)

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.4", GitCommit:"872a965c6c6526caa949f0c6ac028ef7aff3fb78", GitTreeState:"clean", BuildDate:"2022-11-09T13:36:36Z", GoVersion:"go1.19.3", Compiler:"gc", Platform:"darwin/amd64"} Kustomize Version: v4.5.7 Server Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.7", GitCommit:"07a61d861519c45ef5c89bc22dda289328f29343", GitTreeState:"clean", BuildDate:"2023-10-19T00:14:21Z", GoVersion:"go1.20.10", Compiler:"gc", Platform:"linux/amd64"}

Additional context

eli-gc commented 7 months ago

I was able to resolve this by setting this env variable inside my container: ANSIBLE_LOCAL_TEMP