Giter Club home page Giter Club logo

Comments (13)

stefangweichinger avatar stefangweichinger commented on June 19, 2024

Great bug report, thanks.
Maybe we could skip the "is it installed already?" when we test for jinja2 >= 2.10 at the start?
Something like "improved logic only for up2date environments".

I already considered some pre-test tasks for some things like python-version etc

from ansible-rclone.

theenglishway avatar theenglishway commented on June 19, 2024

I guess ansible has a way to issue a warning in that case, so that seems like a fair idea indeed ! (even though it complicates the logic a bit)

But on this specific issue I'm now wondering whether the test (ansible_facts['ansible_local']['rclone']['installed'] is not true) or (ansible_facts['ansible_local']['rclone']['installed_version'] != rclone_version) could not simply be changed to ansible_facts['ansible_local']['rclone']['installed_version'] != rclone_version ?

I guess it would fail anyway if rclone is not installed..

(and that would entirely get rid of that issue with Jinja's "is true" test)

from ansible-rclone.

stefangweichinger avatar stefangweichinger commented on June 19, 2024

to consider, yes. and to test ;-)

from ansible-rclone.

stefangweichinger avatar stefangweichinger commented on June 19, 2024

A quick test in a local branch shows that your suggested test fails at the first run: ansible_facts['ansible_local']['rclone']['installed_version'] has no value/ is not defined yet.

TASK [ansible-rclone : Install the binary] *************************************
fatal: [instance]: FAILED! => {"msg": "The conditional check '(ansible_facts['ansible_local']['rclone']['installed_version'] != rclone_version)' failed. The error was: error while evaluating conditional ((ansible_facts['ansible_local']['rclone']['installed_version'] != rclone_version)): 'dict object' has no attribute 'rclone'\n\nThe error appears to be in '/home/sgw/projects/github/ansible-rclone/tasks/main.yml': line 46, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Install the binary\n  ^ here\n"}

In the former test that isn't a problem because ansible_facts['ansible_local']['rclone']['installed'] is not true at the first run.

from ansible-rclone.

stefangweichinger avatar stefangweichinger commented on June 19, 2024

look at #87 : new test statement, new handling of deploying the fact-checking script etc
Should work with older jinja2 as well.

from ansible-rclone.

dsteinkopf avatar dsteinkopf commented on June 19, 2024

For me the latest update still resulted in an error in the named line. I did some experiments and the following line works for me:

when: (ansible_facts.ansible_local.rclone is not defined) or (ansible_facts.ansible_local.rclone.installed != true) or (ansible_facts['ansible_local']['rclone']['installed_version'] != rclone_version)

from ansible-rclone.

stefangweichinger avatar stefangweichinger commented on June 19, 2024

@dsteinkopf could you show the error you got? My tests in molecule did not fail. What OS, etc?
thanks for suggesting the test, I have a look at it.

from ansible-rclone.

stefangweichinger avatar stefangweichinger commented on June 19, 2024

@dsteinkopf Just to talk about the same code: I think of merging #87 as all the tests succeeded. Please let me know what failed in your runs.

from ansible-rclone.

dsteinkopf avatar dsteinkopf commented on June 19, 2024

Oh, I thought #87 has already been released. My mistake. Sorry for the confusion.
#87 "looks" good to me, as is seems to address the problem I am having with the current galaxy version - I'll try it when it is released.

from ansible-rclone.

stefangweichinger avatar stefangweichinger commented on June 19, 2024

@dsteinkopf I merged #87 right now with commit 6b7153f

28 tests successful -> role was released to galaxy right now

from ansible-rclone.

dsteinkopf avatar dsteinkopf commented on June 19, 2024

New galaxy version works for me. Thank you very much.

from ansible-rclone.

stefangweichinger avatar stefangweichinger commented on June 19, 2024

Great to hear. Thanks for reporting and testing @dsteinkopf

from ansible-rclone.

stefangweichinger avatar stefangweichinger commented on June 19, 2024

@theenglishway If you also have no more issues with the current release, I will close here. Thanks.

from ansible-rclone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.