Comments (11)
Ah. You're right. Give me a moment to update it.
Unfortunately it doesn't auto-update anymore since Travis CI is dead now, I should fix that sometime.
from ansible-role-netbox.
It definitely warrants a release. I think I just forgot. I'm performing a full test locally first to make sure nothing else is broken.
from ansible-role-netbox.
This role relies on the variables being defined so that we know what packages to install. It's not something we can just skip if the variable is undefined.
Can you run ansible-playbook
prefixed with ANSIBLE_STDOUT_CALLBACK=debug
(environment variable) and provide the output from that?
I believe Ansible grabs those variables from /etc/os-release
, which is owned by the base-files
package. Is this file/package possibly missing for you? I tested deployment on the latest Debian vagrant box (from a few days ago) and it seems to still function correctly.
from ansible-role-netbox.
The issue is caused by the fact that when ansible evaluates with_first_found
with an undefined variable it fails hence the bug reference, this was working fine prior to 2.9, the variables are gathered from facts and are there except for one which comes from redhat based systems and is thus undefined
I will create a PR if time permits, for now I've solved it like this:
- name: Include OS-specific variables (Debian).
include_vars: "{{ ansible_distribution | lower }}-{{ ansible_distribution_version.split('.')[0] }}.yml"
when: ansible_os_family == 'Debian'
- name: Include OS-specific variables (RedHat).
include_vars: "{{ ansible_os_family | lower }}-{{ ansible_distribution_version.split('.')[0] }}.yml"
when:
- ansible_os_family == 'RedHat'
- name: Include OS-specific variables (Ubuntu).
include_vars: "{{ ansible_distribution | lower }}-{{ ansible_distribution_version.split('.')[0] }}.yml"
when: ansible_os_family == 'Ubuntu'
from ansible-role-netbox.
I couldn't reproduce it with Ansible 2.14.4, and I wasn't really sure of the relevance of the bug reference, sorry.
Are you talking about ansible_os_family
being undefined? On the clean VM image I'm testing with it appears to be defined, but I don't know if that fact comes from some other package or file.
TASK [debug] *******************************************************************
ok: [default] => {
"ansible_os_family": "Debian"
}
As for the postgres role, that bit seemed more like how they're including variables, not necessarily that that's how they were working around the issue you're referring to. (I can't find any reference to with_first_found in the repository in the first place.)
from ansible-role-netbox.
That's definitely strange:
- name: Debug stuff
debug:
msg: "{{ ansible_distribution }} | {{ ansible_distribution_version }} | {{ ansible_distribution_major_version }} | {{ ansible_os_family }}"
- name: Gather OS specific variables
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version }}.yml"
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_distribution|lower }}.yml"
- "{{ ansible_os_family|lower }}-{{ ansible_distribution_major_version }}.yml"
Output:
TASK [lae.netbox : Debug stuff] ******************************************************************************************************************************************************************************************************
ok: [netbox-dev-local] => {}
MSG:
Debian | 11 | 11 | Debian
TASK [lae.netbox : Gather OS specific variables] *************************************************************************************************************************************************************************************
fatal: [netbox-dev-local]: FAILED! => {}
MSG:
No file was found when using first_found.
PLAY RECAP ***************************************************************************************************************************************************************************************************************************
netbox-dev-local : ok=57 changed=0 unreachable=0 failed=1 skipped=46 rescued=0 ignored=0
I've checked also with ANSIBLE_DEBUG
enabled and the variable resolution was there but for some reason it still refuses to load the variables... Any ideas?
82146 1683215786.56213: search_path:
/home/martino/.ansible/roles/lae.netbox/vars/debian-11.yml
/home/martino/.ansible/roles/lae.netbox/debian-11.yml
/home/martino/.ansible/roles/lae.netbox/tasks/vars/debian-11.yml
/home/martino/.ansible/roles/lae.netbox/tasks/debian-11.yml
from ansible-role-netbox.
Ok mystery solved, I've pulled the role trough galaxy and apparently debian-11.yml is missing... Probably because the artifact on galaxy was not yet updated from this repo.
On top I've cloned the actual repo and mixed them up when editing some stuff...
from ansible-role-netbox.
I believe once you update it we can close this as it should work fine 👯
from ansible-role-netbox.
Updated the Galaxy artifact, though I just checked the change history since v1.0.3 and the Debian 11 definitions aren't actually in that release anyway, so you'd still need to use the git repo with ansible-galaxy
.
I'll see if I can just go ahead and cut a new release anyway and publish that.
from ansible-role-netbox.
Just following the documentation in the README leads to this hole if you're unlucky to be running debian >= 11, would be awesome if the galaxy artifact would include the updates, i guess adding support for a major debian version would warrant a release, but it's up to you.
from ansible-role-netbox.
Alright, done. https://github.com/lae/ansible-role-netbox/releases/tag/v1.0.4
from ansible-role-netbox.
Related Issues (20)
- make it possible to set API Token during creation of the superuser HOT 2
- deploy_netbox.yml is missing trace_paths HOT 1
- cryptography NAPALM dependancy needs rust and newer pip on python36 HOT 3
- Support for environment variables HOT 3
- Netbox 2.11 planning to drop support for python36 HOT 3
- Support for Deployment of Multiple RQ Workers HOT 1
- uWSGI randomly resets TCP connections HOT 3
- Role needs to be updated to latest NetBox HOT 6
- AnsibleUndefinedVariable: {{ ansible_processor_vcpus }} when running role HOT 2
- Install uwsgi in venv and point service file to venv binary HOT 8
- Only run invalidate command if commit is NOT present
- markupsafe 2.1.1 cannot import soft_unicode HOT 1
- Recommended SSL settings HOT 3
- Vagrant Install failing with errors HOT 1
- Support 'clearcache' steps during upgrade in v3.2.3+
- Required Updates for "Up to" NetBox v3.4.2 Support HOT 6
- Implement Custom Validators HOT 4
- RQworker reload fails randomly HOT 2
- Git-based installation: problematic file ownership
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-netbox.