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

.git folder missing under project workspace /running/project #14235

Open
3 tasks done
manojselukar opened this issue Jun 21, 2023 · 7 comments
Open
3 tasks done

.git folder missing under project workspace /running/project #14235

manojselukar opened this issue Jun 21, 2023 · 7 comments

Comments

@manojselukar
Copy link

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that the AWX Operator is open source software provided for free and that I might not receive a timely response.

Bug Summary

After starting job, seen repository is being cloned under /runner/project is missing .git folder

bash-4.4# pwd
/runner/project

bash-4.4# ls -a
. .. .DS_Store .gitmodules README.md ansible ansible-lint.yaml ansible.cfg docker docs jenkins mkdocs.yml scripts src yaml_lint.yaml
bash-4.4#

AWX Operator version

2.2.1

AWX version

22.3.0

Kubernetes platform

kubernetes

Kubernetes/Platform version

v1.22.6

Modifications

no

Steps to reproduce

Create a template > run job > login to running automation container >> cd /runner/project

Expected results

repository clone path should have .git folder

bash-4.4# ls -a
. .. .git .DS_Store .gitmodules README.md ansible ansible-lint.yaml ansible.cfg docker docs jenkins mkdocs.yml scripts src yaml_lint.yaml

Actual results

bash-4.4# ls -a
. .. .DS_Store .gitmodules README.md ansible ansible-lint.yaml ansible.cfg docker docs jenkins mkdocs.yml scripts src yaml_lint.yaml

Additional information

also the additional roles get cloned from repos specified under file requirements.yml also missing .git folders

Operator Logs

No response

@enidvrenozaj
Copy link

enidvrenozaj commented Jun 29, 2023

I am facing a similar issue but I have:

  • AWX version 22.3.1.dev57+gfb8fadc7f9 running standalone installed with docker-compose
  • Using ghcr.io/ansible/awx_devel:devel image
  • Syncing all projects/repos I can view all .git directories inside /var/lib/awx/projects/_name_of_proj/
  • when running any template playbook with image for example: quay.io/ansible/awx-ee:latest I do not see any .git directories inside the container on /runner/project

@kurokobo
Copy link
Contributor

Could you clarify why the .git directory is required under /runner/project for your use case?

Currently, it's designed. .git directory is explcitly ignored during sending projcet directory to automation job pod.

  1. The project is cloned under /var/lib/awx/projects on task container, by project syncing
  2. The projcet directory is copied to temporary working space for ansible runner with ignoring .git directory, on job run
  3. That working space is archived and sent to automation job pod, then extracted under /runner on the pod, by ansible runner

@enidvrenozaj
Copy link

enidvrenozaj commented Jun 29, 2023

@kurokobo thanks for the quick response.
In fact I have some special tasks which discover the git branch and send the notification via slack module to a channel about the playbook execution. I know that awx has Slack and email notifications but I wanted to find out if I could use the same flow that I currently have.
If that is not possible or does not make sense to change, I guess I should stick with the AWX notifications.

@kurokobo
Copy link
Contributor

@enidvrenozaj
Thanks for clarify your situation.
I don't know if this is helpful for you, but there are some variables that contains metadata for the job and usable in your playbook:

# Contains current revision for the project
"awx_project_revision": "e4fc3b2a91e6392e7604886687ebeba725eed73b",

# Contains current branch for the project, if target branch was specified on the project page
"awx_project_scm_branch": "main",

To copy the .git directory under /runner, the code needs to be modified (revert #12356, or modify args for copytree (or make the args configurable through ui).

@AlanCoding
I saw your #7367 and #12356 so just letting you know there are some users who have requirements that require .git on the automation job pod.

@michalg91
Copy link

I am facing the same issue, i have custom vars_plugin which does nothing else than running git-crypt unlock on playbook directory. Right now it is not working with awx since there is no .git in copied repo.

@fosterseth fosterseth transferred this issue from ansible/awx-operator Jul 13, 2023
@xPancakery
Copy link

Is there an update on this issue? I'm also needing to have the .git from the repo in the runner

@starowner
Copy link

Hello Guys, Can someone tell me whether this bug fixed? Or do we have any option to disable it? We need it for our work.

Thank you.

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

No branches or pull requests

6 participants