-
Notifications
You must be signed in to change notification settings - Fork 166
synchronize doesn't parse variables for ansible_user #275
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
Comments
I believe that this is because See also: So in fact, I don't know that it is possible (or recommended) to solve this within the The way I would recommend fixing this is to have an explicit option in the plugin for setting the user. It can still default to reading the user from - name: ANSISTRANO | RSYNC DIRECT | Rsync application files directly to remote release path
synchronize:
src: "{{ ansistrano_deploy_from }}"
dest: "{{ ansistrano_release_path.stdout }}"
set_remote_user: yes
recursive: yes
delete: yes
archive: yes
compress: yes
use_ssh_args: "{{ ansistrano_rsync_use_ssh_args | default(omit) }}"
rsync_opts: "{{ ansistrano_rsync_extra_params | default(omit) }}"
rsync_path: "{{ ansistrano_rsync_path | default(omit) }}"
remote_user: '{{ ansible_user }}' (see last line) If To workaround this issue now, with no changes, you can use - name: "Set the value of ansible_user"
set_fact:
ansible_user: '{{ ansible_user }}'
- name: ANSISTRANO | RSYNC DIRECT | Rsync application files directly to remote release path
synchronize:
src: "{{ ansistrano_deploy_from }}"
dest: "{{ ansistrano_release_path.stdout }}"
set_remote_user: yes
recursive: yes
delete: yes
archive: yes
compress: yes
use_ssh_args: "{{ ansistrano_rsync_use_ssh_args | default(omit) }}"
rsync_opts: "{{ ansistrano_rsync_extra_params | default(omit) }}"
rsync_path: "{{ ansistrano_rsync_path | default(omit) }}" But this is not desirable in all cases. You will be setting the precedence of that value differently than it was previously, so you may it find it has an unexpected value in other places where you tried to override it without using |
@Vanav Thank you for reporting this. Is there any chance to try the workaround that @briantist provided ? |
For my use case I was able just to remove variable. But this is definitely unexpected behavior. Maybe it is also a security and data loss risk, because
|
I just ran into this in a playbook where I was setting In my case, the workaround by @briantist wouldn't work (as he notes, "not desirable in all cases"). Although the ability to set the My workaround right now is to set Here's an example of what I'm doing:
|
This worked in Not sure if this helps, though. |
+1 |
This is a nasty bug and it doesn't seem like the issue would be too hard to fix. Could someone take a look at it? I still have to stay with version 1.2.0 until fixed. 🤷🏼♂️ |
Uh oh!
There was an error while loading. Please reload this page.
SUMMARY
When using variable in
ansible_user
, and the default valueset_remote_user=true
, then we got error:group_vars/all/default.yml
task.yml
Output (added line breaks):
As you can see, text
{{ deploy_user }}
inserted as is, even with spaces, and so SSH login}}
is used.ISSUE TYPE
COMPONENT NAME
synchronize
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 20.04
The text was updated successfully, but these errors were encountered: