Saving ansible release path to a manifest.json file?

I’d like to save the release path used when trellis creates a new deployment. Any ideas on how to accomplish this?

Just create a hook file for deploy_after and you can access deploy_helper.release_path in there. Put a task like this in there:

- name: Write release path to manifest file
  copy:
    content: "{{ deploy_helper.release_path }}"
    dest: /path/to/manifest.json

Or use the lineinfile module for more advanced stuff.

1 Like