Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Changing current not working #1

Open
@frimdo

Description

@frimdo

Brief explanation of problem

When current_path variable is changed, symlink is still created as deploy_helper.current_path/current

Reproducing of problem

When ran this playbook using ansible

---
- hosts: testing

  vars:
  - working_directory: "{{ ansible_env.HOME }}/test_script"

  tasks:
  - name: Initialize the deploy root and gather facts
    deploy_helper: path="{{ working_directory }}"
                   releases_path="{{ working_directory }}/releases"
                   shared_path="{{ working_directory }}/shared"
                   current_path="{{working_directory}}/here"

  - name: Create new release folder
    file: path={{ deploy_helper.new_release_path }} state=directory 

  - name: Add an unfinished file, to allow cleanup on successful finalize
    file: path={{ deploy_helper.new_release_path }}/{{ deploy_helper.unfinished_filename }} state=touch

  - name: Creating some files 
    file: path={{deploy_helper.new_release_path}}/Some_random_empty_file.txt state=touch

  - name: Finalize the deploy, removing the unfinished file and switching the symlink
    deploy_helper: path="{{ working_directory }}" release="{{ deploy_helper.new_release }}" state=finalize keep_releases=1 clean=True

  - debug: msg="Current path {{deploy_helper.current_path}} \nNew release path {{deploy_helper.new_release_path}}"

Expected output

Output of ansible:

...
TASK [debug] *******************************************************************
ok: [defconf.com] => {
    "msg": "Current path /home/defconf/test_script/here \nNew release path /home/defconf/test_script/releases/20160629185605"
}
...

Output of ls command

# ls $HOME/test_script/
here@  releases/  shared/

Real output

Output of ansible:

...
TASK [debug] *******************************************************************
ok: [defconf.com] => {
    "msg": "Current path /home/defconf/test_script/here \nNew release path /home/defconf/test_script/releases/20160629185605"
}
...

Output of ls command

# ls $HOME/test_script/
current@  releases/  shared/

The problem explanation

The finalization seems to work well, the symlink is created, but changing current_path variable (output of debug task shows that variable was changed) seems not to change anything. Trying to create symlink in different directory does not work as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions