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

install nvm not idempotent? #10

Open
strarsis opened this issue Jan 15, 2016 · 2 comments
Open

install nvm not idempotent? #10

strarsis opened this issue Jan 15, 2016 · 2 comments

Comments

@strarsis
Copy link

strarsis commented Jan 15, 2016

Each time I re-apply the playbook (after its successful aplication),
the install nvm task still runs each time - and takes a considerable amount of time to finish:
[...]
TASK [leonidas.nvm : Install nvm]
[...]
Is this task not idempotent? Or should it check nvm version before downloading things?

@Wtower
Copy link

Wtower commented Jan 29, 2016

Idempotence is not relevant with the amount of time to execute.

Idempotence is the property of certain operations in mathematics and computer science, that can be applied multiple times without changing the result beyond the initial application.

Source

Other useful links: Ansible glossary

You can confirm that the task is idempotent if ansible reports it as changed after running it consecutively with no other changes in between:

Run 1:

TASK [ansible-nvm : Install 0.10] **********************************************
changed: [default]

Run 2:

TASK [ansible-nvm : Install 0.10] **********************************************
ok: [default]

If you run the command manually nvm reports that version is already installed.

@Wtower
Copy link

Wtower commented Jan 29, 2016

After further investigation, it appers that recent nvm versions output the 'already installed' message in stderr rather than stdout, therefore the relevant task indeed does not accurately check with changed_when. I will fix that after some pending changes.

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

2 participants