-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(git_clone): change ownership on copy #62
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming this is verified to work, lgtm. We'd need to adjust https://github.com/radiorabe/ansible-collection-rabe_foreman/blob/main/roles/foreman/tasks/host_groups.yaml in that case.
I took this for a spin locally and now need to figure out why it's complaining:
i'm pretty sure the description was copy-pasta from the docs... looking back, i'm not sure from where. |
049a184
to
6b9673f
Compare
I kinda works with this play: ---
- name: Play
hosts: [localhost]
roles:
- role: git_clone
vars:
radiorabe_git_clone:
- repo: [email protected]:radiorabe/ansible-collection-common.git
dest: /tmp/checkout
single_branch: yes
version: main
radiorabe_git_local_clone: true
radiorabe_git_clone_remote_owner: hairmare
radiorabe_git_clone_remote_group: testgroup
radiorabe_git_clone_remote_dest: "/tmp/dest" It's awfully slow because it copies the .git folder and does a chown on each individual file. $ ansible-playbook play.yaml
_____________
< PLAY [Play] >
-------------
\
\
_____ _________
/ \_/ |
| ||
| ||
| ###\ /### | |
| 0 \/ 0 | |
/| | |
/ | < |\ \
| /| | | |
| | \_______/ | | |
| | | / /
/|| /|||
----------------|
| | | |
*** ***
/___\ /___\
________________________
< TASK [Gathering Facts] >
------------------------
\ ____
\ / \
| ^__^ |
| (oo) |______
| (__) | )\/\
\____/|----w |
|| ||
Moofasa
ok: [localhost]
_______________________________________________________
/ TASK [git_clone : RaBe Common : git_clone : Clone git \
\ repository locally] /
-------------------------------------------------------
\ ____________
\ |__________|
/ /\
/ / \
/___________/___/|
| | |
| ==\ /== | |
| O O | \ \ |
| < | \ \|
/| | \ \
/ | \_____/ | / /
/ /| | / /|
/||\| | /||\/
-------------|
| | | |
<__/ \__>
[WARNING]: Using a variable for a task's 'args' is unsafe in some situations (see https://docs.ansible.com/ansible/devel/reference_appendices/faq.html#argsplat-unsafe)
ok: [localhost -> 127.0.0.1] => (item={'repo': '[email protected]:radiorabe/ansible-collection-common.git', 'dest': '/tmp/checkout', 'single_branch': True, 'version': 'main'})
___________________________________________________________
/ TASK [git_clone : RaBe Common : git_clone : Copy files to \
\ remote] /
-----------------------------------------------------------
\
\ \_\_ _/_/
\ \__/
(oo)\_______
(__)\ )\/\
||----w |
|| ||
changed: [localhost] => (item={'repo': '[email protected]:radiorabe/ansible-collection-common.git', 'dest': '/tmp/checkout', 'single_branch': True, 'version': 'main'})
____________
< PLAY RECAP >
------------
\
\
.::!!!!!!!:.
.!!!!!:. .:!!!!!!!!!!!!
~~~~!!!!!!. .:!!!!!!!!!UWWW$$$
:$$NWX!!: .:!!!!!!XUWW$$$$$$$$$P
$$$$$##WX!: .<!!!!UW$$$$" $$$$$$$$#
$$$$$ $$$UX :!!UW$$$$$$$$$ 4$$$$$*
^$$$B $$$$\ $$$$$$$$$$$$ d$$R"
"*$bd$$$$ '*$$$$$$$$$$$o+#"
"""" """""""
localhost : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
$ ls -al /tmp/checkout/
total 52
drwxr-xr-x. 6 hairmare hairmare 220 13. Jan 18:43 .
drwxrwxrwt. 28 root root 660 13. Jan 18:48 ..
-rw-r--r--. 1 hairmare hairmare 740 13. Jan 18:43 .ansible-lint-ignore
-rw-r--r--. 1 hairmare hairmare 111 13. Jan 18:43 .ansible-lint.yml
-rw-r--r--. 1 hairmare hairmare 579 13. Jan 18:43 galaxy.yml
drwxr-xr-x. 8 hairmare hairmare 300 13. Jan 18:46 .git
drwxr-xr-x. 3 hairmare hairmare 80 13. Jan 18:43 .github
-rw-r--r--. 1 hairmare hairmare 34520 13. Jan 18:43 LICENSE
drwxr-xr-x. 2 hairmare hairmare 60 13. Jan 18:43 meta
-rw-r--r--. 1 hairmare hairmare 986 13. Jan 18:43 README.md
drwxr-xr-x. 8 hairmare hairmare 160 13. Jan 18:43 roles
$ ls -al /tmp/dest/
total 52
drwxr-xr-x. 6 hairmare testgroup 220 13. Jan 18:44 .
drwxrwxrwt. 27 root root 640 13. Jan 18:48 ..
-rw-r--r--. 1 hairmare testgroup 740 13. Jan 18:43 .ansible-lint-ignore
-rw-r--r--. 1 hairmare testgroup 111 13. Jan 18:43 .ansible-lint.yml
-rw-r--r--. 1 hairmare testgroup 579 13. Jan 18:43 galaxy.yml
drwxr-xr-x. 7 hairmare testgroup 280 13. Jan 18:46 .git
drwxr-xr-x. 3 hairmare testgroup 80 13. Jan 18:44 .github
-rw-r--r--. 1 hairmare testgroup 34520 13. Jan 18:43 LICENSE
drwxr-xr-x. 2 hairmare testgroup 60 13. Jan 18:44 meta
-rw-r--r--. 1 hairmare testgroup 986 13. Jan 18:43 README.md
drwxr-xr-x. 6 hairmare testgroup 120 13. Jan 18:44 roles |
No description provided.