fix: sync agent skills over local connection

This commit is contained in:
Haitao Pan 2026-06-14 09:33:58 +08:00
parent 4c330b7e1c
commit 7f6854e9de

View File

@ -318,15 +318,26 @@
| list
)
+ agent_skills_rsync_extra_opts
+ (
((ansible_connection | default('ssh')) == 'local')
| ternary(
[],
['-e', 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null']
)
)
+ [
'-e',
'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null',
item ~ '/',
(
ansible_user | default(ansible_ssh_user) | default('root')
) ~ '@' ~ (
ansible_host | default(inventory_hostname)
) ~ ':' ~ agent_skills_remote_dir ~ '/'
((ansible_connection | default('ssh')) == 'local')
)
| ternary(
agent_skills_remote_dir ~ '/',
(
ansible_user | default(ansible_ssh_user) | default('root')
) ~ '@' ~ (
ansible_host | default(inventory_hostname)
) ~ ':' ~ agent_skills_remote_dir ~ '/'
)
]
}}
register: agent_skills_rsync_result