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

rsync_extra_opts should be array instead of string #225

Closed
zmyrgel opened this issue May 8, 2017 · 6 comments
Closed

rsync_extra_opts should be array instead of string #225

zmyrgel opened this issue May 8, 2017 · 6 comments

Comments

@zmyrgel
Copy link

zmyrgel commented May 8, 2017

Hi,

Ansistrano incorrectly passes rsync_opts as string when array is expected.
This breaks rsync copying with ansible 2.3.0.

Simple fix was to pass it an array so change the defaults/main.yml:
-ansistrano_rsync_extra_params: ""
+ansistrano_rsync_extra_params: []

For more information:
http://docs.ansible.com/ansible/synchronize_module.html#options
ansible/ansible#23575

@tersmitten
Copy link
Contributor

Also see #121

@tersmitten
Copy link
Contributor

tersmitten commented May 8, 2017

And #82

@zmyrgel
Copy link
Author

zmyrgel commented May 9, 2017

Ok, old news then.

At least for me the default rsync builds got broken.
I'm deploying my apps subdirectory:
ansistrano_deploy_from: "{{ playbook_dir }}/src"

With Ansible versions before 2.3 this worked just fine and I got all the files in src directory on my servers. Once the ansible got updated to 2.3 the rsync deployment got broken and instead of having just src directory contentes on server I also got the top-level contents for some reason. After changing the ansistrano_rsync_extra_params to array the expected behavior returned.

@ricardclau
Copy link
Member

The current setup works for all Ansible versions, including 2.3.0 which we test in Travis as you can see

@zmyrgel
Copy link
Author

zmyrgel commented May 10, 2017

Current setup doesn't work on 2.3.0 as expected.

The problem can be seen with following steps by using the example directories my-app:
move my-app my-playbook so directory structure looks like:

deploy-svn.yml
deploy.yml
hosts
my-app/
rollback.yml

change deploy.yml to:

---
- name: Deploy example app to my-server.com
  hosts: all
  become: false
  vars:
    ansistrano_deploy_from: "{{ playbook_dir }}/my-app/"
    ansistrano_deploy_to: "/tmp/my-app.com"
    ansistrano_keep_releases: 3
    ansistrano_deploy_via: rsync
  roles:
    - role: carlosbuenosvinos.ansistrano-deploy

When ansistrano-deploy defaults/main.yml has 'ansistrano_rsync_extra_params: ""' I get following files on deployment dir:

[tmp]$ ls -R my-app.com/
my-app.com/:
current  releases  shared

my-app.com/releases:
20170510065131Z

my-app.com/releases/20170510065131Z:
deploy-svn.yml  deploy.yml  hosts  index.html  my-app  REVISION  rollback.yml

my-app.com/releases/20170510065131Z/my-app:
index.html

my-app.com/shared:

when I use older ansible version or change the ansistrano_rsync_extra_params: to [] I get following:

[tmp]$ ls -R my-app.com/
my-app.com/:
current  releases  shared

my-app.com/releases:
20170510070030Z

my-app.com/releases/20170510070030Z:
index.html  REVISION

my-app.com/shared:

So in addition to the files I wanted to deploy, all files from my sub-directory, now I also get all top-level contents as well which seems to be an error.

@ricardclau ricardclau reopened this May 10, 2017
@ricardclau
Copy link
Member

Seems to be an Ansible problem, as reported in #227

Not much we can do I am afraid

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

No branches or pull requests

3 participants