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

Download forgejo archive is not being skipped in check mode #163

Open
pat-s opened this issue May 18, 2024 · 0 comments
Open

Download forgejo archive is not being skipped in check mode #163

pat-s opened this issue May 18, 2024 · 0 comments

Comments

@pat-s
Copy link
Contributor

pat-s commented May 18, 2024

I have the following vars set

    gitea_version: 7.0.2
    gitea_version_check: false

and running the role in check mode results in

TASK [roles-ansible.gitea : Download forgejo archive] ***************************************************************************************************************************
Saturday 18 May 2024  10:29:56 +0200 (0:00:01.209)       0:00:09.682 **********
Saturday 18 May 2024  10:29:56 +0200 (0:00:01.209)       0:00:09.682 **********
FAILED - RETRYING: [homelab-de]: Download forgejo archive (5 retries left).
FAILED - RETRYING: [homelab-de]: Download forgejo archive (4 retries left).
FAILED - RETRYING: [homelab-de]: Download forgejo archive (3 retries left).
FAILED - RETRYING: [homelab-de]: Download forgejo archive (2 retries left).
FAILED - RETRYING: [homelab-de]: Download forgejo archive (1 retries left).
fatal: [homelab-de]: FAILED! => {"attempts": 5, "changed": false, "dest": "/tmp/forgejo-7.0.2-linux-arm64", "elapsed": 0, "gid": 0, "group": "root", "mode": "0640", "msg": "Request failed", "owner": "root", "response": "HTTP Error 404: Not Found", "secontext": "unconfined_u:object_r:admin_home_t:s0", "size": 103036200, "state": "file", "status_code": 404, "uid": 0, "url": "https://code.forgejo.org/attachments/a00333ad-250a-4d30-a764-9a37fb24f419"}

According to AI this is because of

Since not gitea_version_check | bool evaluates to true, the entire condition evaluates to true immediately due to the or operator. In logical expressions using or, if any part of the expression is true, the entire expression is true.

Setting gitea_version_check: true solves the issue. But I'd argue that check mode should work regardless of whether gitea_version_check is true or false?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant