trellis icon indicating copy to clipboard operation
trellis copied to clipboard

Finalizing deploys broken on Ansible 2.x

Open swalkinshaw opened this issue 10 years ago • 12 comments

Creating here so we can track it even though it's a bug within Ansible. We use the deploy_helper and the deploy will fail on the last step during finalizing (symlinking current).

The bug was fixed in https://github.com/ansible/ansible-modules-extras/commit/1dd62b13fa532b9335782f26c253495df6df1c1d but the latest Ansible 2.0.0.2 hasn't updated their "extras" module to include that commit yet.

swalkinshaw avatar Jan 16 '16 19:01 swalkinshaw

Do you recommend any kind of quick patch for this? This is happening to me on Ansible 2.0.0.1

Downgrading to Ansible 2.0.0.0 supposedly resolves the issue for now. I'm wrestling with homebrew to see if that works but I wanted to know if you thought it would be better to comment out that task and manually symlink the current directory until the patch is included

conrman avatar Jan 17 '16 22:01 conrman

2.0.0 won't work either. That comment meant they "downgraded" to the dev build.

A workaround would be to remove the finalize task and manually do two things: https://github.com/stivio/ansible-modules-extras/blob/1dd62b13fa532b9335782f26c253495df6df1c1d/web_infrastructure/deploy_helper.py#L446-L447

  1. delete unfinished file
  2. create symlink

It's just 2 simple tasks. If you end up doing it maybe we'd add it to Trellis as a stop-gap.

swalkinshaw avatar Jan 17 '16 23:01 swalkinshaw

I updated my OS last night and my package manager moved to Ansible 2.0.0.2. Deploys are now failing due to unset subtree paths (not in use):

task path: <path>/trellis/roles/deploy/tasks/prepare.yml:18
fatal: [<host>]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"msg": "subtree is set to 'False' but that path does not exist in the repo. Edit `subtree_path` for '<site>' in `wordpress_sites.yml`.

I've moved back to 1.9.4 for now.

davenaylor avatar Jan 21 '16 14:01 davenaylor

@davenaylor could you tell what OS and how you manage ansible on your system?

Example:

  • OSX 10.11.x / Homebrew package manager
  • Linux/Ubuntu / Apt package manager
  • Linux/Arch / Source installation

For example using OSX with homebrew you can uninstall ansible and install homebrew/versions/ansible19 and use that until fix for 2.x is announced.

madalinignisca avatar Jan 27 '16 09:01 madalinignisca

For people looking for a quick fix, it's super easy to just find the file deploy_helper.py on your system ( locate deploy_helper.py ) and edit those two lines manually: https://github.com/ansible/ansible-modules-extras/commit/1dd62b13fa532b9335782f26c253495df6df1c1d

baptistemarchand avatar Jan 27 '16 10:01 baptistemarchand

@16nsk Linux Arch. Like I say though, I moved back to 1.9.4 for now.

davenaylor avatar Jan 27 '16 10:01 davenaylor

Still not fixed?

landerss0n avatar Feb 03 '16 20:02 landerss0n

PR's accepted

Sent from my iPhone

On Feb 3, 2016, at 1:35 PM, Lucas Andersson [email protected] wrote:

Still not fixed?

— Reply to this email directly or view it on GitHub.

retlehs avatar Feb 03 '16 20:02 retlehs

I got this error, then tried to dowgrade to 1.9.4. When running the deploy script, I get

ERROR: fail is not a legal parameter in an Ansible task or handler

This is from a brand new trellis checkout from earlier this week. I am going to just use the current Ansible release and try @baptistmarchand suggestion

nbyloff avatar Feb 04 '16 18:02 nbyloff

Hi. What is a reliable workaround for this? On Ansible 2 I get the error about 'vars_files' is not a valid attribute for a PlaybookInclude and on Ansible 1.9, the "fail is not a legal parameter." I tried the workaround in https://github.com/ansible/ansible-modules-extras/commit/1dd62b13fa532b9335782f26c253495df6df1c1d with no luck.

Is there a version of Ansible that this works on, and/or a workaround that I could apply despite being quite new to Ansible usage?

JohnKelty avatar Apr 20 '16 23:04 JohnKelty

@JohnKelty this has been fixed for a while in Trellis. The version requirements are in the README.

swalkinshaw avatar Apr 20 '16 23:04 swalkinshaw

Indeed it has. I saw the error was the same as what I was working on and forgot to notice that the playbook in question was different, so please ignore my comment and sorry for the inconvenience I'll follow this up in the right place.

JohnKelty avatar Apr 21 '16 16:04 JohnKelty