Trellis: Finalizing deploys broken on Ansible 2.x

Created on 16 Jan 2016  Â·  12Comments  Â·  Source: roots/trellis

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.

bug

Most helpful comment

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

All 12 comments

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

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.

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 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.

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

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

Still not fixed?

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.

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

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 this has been fixed for a while in Trellis. The version requirements are in the README.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amelotrgr picture amelotrgr  Â·  6Comments

dreamon11 picture dreamon11  Â·  7Comments

joejordanbrown picture joejordanbrown  Â·  8Comments

vercotux picture vercotux  Â·  3Comments

reverbsoul picture reverbsoul  Â·  8Comments