GithubHelp home page GithubHelp logo

Comments (7)

Migsi avatar Migsi commented on July 21, 2024 1

I managed to sort out the issue regarding the unrelated var password and thus was able to run the locale role again. It was all my fault messing up variables. Anyway it is not clear, why your role initially triggered the behavior, especially as in the play where it is used all those vars must be populated for the rest to work (which it does). This suggests there are some issues with var handling within Ansible itself, I might open a bug report at their repo. Problem solved, yay! At least i thought so...
Unfortunately I encountered a new issue after the play went through. As that issue is unrelated, I'll open a new issue report for it.

from ansible-role-locale.

robertdebock avatar robertdebock commented on July 21, 2024 1

Good to hear your issue is "fixes", indeed please make issues for any problem you spot, it helps me and all other users of these roles. Thanks!

from ansible-role-locale.

robertdebock avatar robertdebock commented on July 21, 2024

I think it has to do with your setup; the password attribute is not related to this role.

The error you are seeing comes from this code:

- name: test if locale_lang is set correctly
  ansible.builtin.assert:
    that:
      - locale_lang is defined
      - locale_lang is string
    quiet: yes

Maybe just to be sure you can quote your values:

locale_lang: "en_GB.UTF-8"
locale_timezone: "Europe/Vienna"

Although I don't really expect that to cause an issue.

Hope you find the issue, please reopen if you need further help.

from ansible-role-locale.

Migsi avatar Migsi commented on July 21, 2024

Maybe just to be sure you can quote your values:

locale_lang: "en_GB.UTF-8"
locale_timezone: "Europe/Vienna"

Although I don't really expect that to cause an issue.

You were right about that not causing the issue.

I think it has to do with your setup; the password attribute is not related to this role.

I can't imagine what is causing the assertion to fail. No other role/task is messing with locales, and I checked the host, they are all set properly (to "C", no clue why, but its fine, its the initial state that should get changed by this role).
Regarding the misterious password attribute, I can't find any hints on where it comes from. We don't use assertions ourself. Anyway it wouldn't make a lot of sense if your assertion is triggered by a previous handled one (that looked for password somewhere), though I can't say for sure there exists a bug within ansible itself?

If you don't mind, I'd ask you to reopen the issue as I still don't have a fix.

from ansible-role-locale.

robertdebock avatar robertdebock commented on July 21, 2024

What a strange error, I'm actually curious where it comes from.

Can you run the playbook with a couple of '-vvv's?

from ansible-role-locale.

Migsi avatar Migsi commented on July 21, 2024

Sorry for my late response, I didn't have time to retry this earlier. I ran the play using -vvvvvv (should be one more than max verbosity?) but the (above posted) output stayed the same. Allthough, the role call itself outputted some more, but I guess useless information.

TASK [Change locale using external role] **************************************************************************************************************************************************************************
task path: /path/to/ansible/provisioning/roles/common/tasks/main.yml:76
Read vars_file 'vars/common.yml'
Read vars_file 'vars/authorized_keys.yml'
Read vars_file 'vars/gpg_keys.yml'
Read vars_file 'vars/common.yml'
Read vars_file 'vars/authorized_keys.yml'
Read vars_file 'vars/gpg_keys.yml'
Read vars_file 'vars/common.yml'
Read vars_file 'vars/authorized_keys.yml'
Read vars_file 'vars/gpg_keys.yml'
Read vars_file 'vars/common.yml'
Read vars_file 'vars/authorized_keys.yml'
Read vars_file 'vars/gpg_keys.yml'
Read vars_file 'vars/common.yml'
Read vars_file 'vars/authorized_keys.yml'
Read vars_file 'vars/gpg_keys.yml'
statically imported: /path/to/.ansible/roles/robertdebock.locale/tasks/assert.yml
Read vars_file 'vars/common.yml'
Read vars_file 'vars/authorized_keys.yml'
Read vars_file 'vars/gpg_keys.yml'
Read vars_file 'vars/common.yml'
Read vars_file 'vars/authorized_keys.yml'
Read vars_file 'vars/gpg_keys.yml'
Read vars_file 'vars/common.yml'
Read vars_file 'vars/authorized_keys.yml'
Read vars_file 'vars/gpg_keys.yml'
Read vars_file 'vars/common.yml'
Read vars_file 'vars/authorized_keys.yml'
Read vars_file 'vars/gpg_keys.yml'

TASK [robertdebock.locale : test if locale_lang is set correctly] *************************************************************************************************************************************************
task path: /path/to/.ansible/roles/robertdebock.locale/tasks/assert.yml:3
fatal: [my.remote.host -> localhost]: FAILED! => {
    "msg": "'dict object' has no attribute 'password'"
}

NO MORE HOSTS LEFT ************************************************************************************************************************************************************************************************

from ansible-role-locale.

Migsi avatar Migsi commented on July 21, 2024

I'm suspecting the issue is triggered by some sort of underlying ansible bug. I managed to reproduce the exact same issue on a different play, using partially the same vars as in the play I mentioned above. Appearently the unrelated var password is not properly populated during this play. I still didn't manage to understand exactly why, but I'll look into it. In the meantime I was able to circumvent it by reducing the inventory to those hosts I'm intrested in at play time and disabling error_on_undefined_vars in ansible config.

I didn't try yet if the mentioned workaround allows me to use your role again, I'll test it ASAP and close the issue if I succeed.

from ansible-role-locale.

Related Issues (4)

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.