[GH-ISSUE #1444] local ansible build fails at Gather variables for each operating system #455

Open
opened 2026-02-27 14:51:51 +03:00 by kerem · 1 comment
Owner

Originally created by @nimbius on GitHub (Mar 31, 2024).
Original GitHub issue: https://github.com/netbootxyz/netboot.xyz/issues/1444

[X]: This bug persists when memory is increased beyond 8GB.
(RAM for the build system is 2TB)

Describe the bug

ansible build fails at step TASK [netbootxyz : Gather variables for each operating system]
fatal: [localhost]: FAILED! => {"msg": "No file was found when using first_found."}

output has an override to /tmp/ because unprivileged build users dont touch /var/www.

To Reproduce
Steps to reproduce the behavior:

  1. build ansible local version of netboot.xyz for localhost

Expected behavior

we complete the variable gathering?
Screenshots

Additional context

full debug output:
TASK [netbootxyz : Gather variables for each operating system] *****************************************************************************************************************************************************************************************************************************
task path: /home/cicero/netboot.xyz/roles/netbootxyz/tasks/generate_disks_base.yml:6
fatal: [localhost]: FAILED! => {
"msg": "No file was found when using first_found."
}

PLAY RECAP *********************************************************************************************************************************************************************************************************************************************************************************
localhost : ok=12 changed=0 unreachable=0 failed=1 skipped=9 rescued=0 ignored=0

ansible version used is ansible [core 2.16.5]

Originally created by @nimbius on GitHub (Mar 31, 2024). Original GitHub issue: https://github.com/netbootxyz/netboot.xyz/issues/1444 [X]: This bug persists when memory is increased beyond 8GB. (RAM for the build system is 2TB) <!-- Please validate that the issue is not a symptom of insufficient memory. Many installation media are based on live-cd images that require more than a few MB/GB of memory to run. --> **Describe the bug** <!-- A clear and concise description of what the bug is. --> ansible build fails at step TASK [netbootxyz : Gather variables for each operating system] fatal: [localhost]: FAILED! => {"msg": "No file was found when using first_found."} output has an override to /tmp/ because unprivileged build users dont touch /var/www. **To Reproduce** Steps to reproduce the behavior: 1. build ansible local version of netboot.xyz for localhost **Expected behavior** <!-- A clear and concise description of what the bug is. --> we complete the variable gathering? **Screenshots** <!-- If applicable, add screenshots to help explain your problem. --> **Additional context** <!-- Add any other context about the problem here. --> full debug output: TASK [netbootxyz : Gather variables for each operating system] ***************************************************************************************************************************************************************************************************************************** task path: /home/cicero/netboot.xyz/roles/netbootxyz/tasks/generate_disks_base.yml:6 fatal: [localhost]: FAILED! => { "msg": "No file was found when using first_found." } PLAY RECAP ********************************************************************************************************************************************************************************************************************************************************************************* localhost : ok=12 changed=0 unreachable=0 failed=1 skipped=9 rescued=0 ignored=0 ansible version used is ansible [core 2.16.5]
Author
Owner

@veloxsouth commented on GitHub (Apr 25, 2024):

I had the same issue on a fresh install of Archlinux.
I have never worked with ansible before so pardon if I make any bad reasoning but my issue was solved.

[root@netbootxyz netboot.xyz]# ansible-playbook -i inventory site.yml

gives the same error for me

The error message says it's coming from line 6 of generate_disks_base.yml shown here

[root@netbootxyz netboot.xyz]# cat roles/netbootxyz/tasks/generate_disks_base.yml

---

- name: Gathering facts
  ansible.builtin.setup:

- name: Gather variables for each operating system
  ansible.builtin.include_vars: "{{ item }}"
  with_first_found:
    - "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
    - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
    - "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
    - "{{ ansible_distribution | lower }}.yml"
    - "{{ ansible_os_family | lower }}.yml"

The file names it is trying to find are generated from ansible.builtin.setup with the previous gathered facts step. On my system you can see one of those values here.

[root@netbootxyz netboot.xyz]# ansible localhost -m ansible.builtin.setup | grep ansible_os_family

[WARNING]: No inventory was parsed, only implicit localhost is available
        "ansible_os_family": "Archlinux",

So if it's looking for a file named "ansible_os_family | lower" would reduce to "archlinux.yml", but in what path?

[root@netbootxyz netboot.xyz]# find . -type f -name "*.yml"

 . . .
./user_overrides.yml
./script/netbootxyz-overrides.yml
./roles/netbootxyz/vars/ubuntu.yml
./roles/netbootxyz/vars/debian.yml
./roles/netbootxyz/vars/redhat.yml
./roles/netbootxyz/vars/main.yml

I see some os families have their own ansible files, but not archlinux. They seem responsible for installing packages in apt and pip, so I created a similar file that was empty with the understanding I might have to do some manual installs later.

.roles/netbootxyz/vars/archlinux.yml

---
netbootxyz_packages: []

pipxe_packages: []

After creating this file and running the following command, it appears to work and NBPs are generated.

[root@netbootxyz netboot.xyz]# ansible-playbook -i inventory site.yml

PLAY RECAP ********************************************************************************************************************************
localhost                  : ok=40   changed=16   unreachable=0    failed=0    skipped=22   rescued=0    ignored=0

I do not know what a more robust archlinux.yml file should contain to support self hosting netbootxyz the stub I created was sufficient. The only packages I installed manually were ansible, apache, and git.

<!-- gh-comment-id:2078228465 --> @veloxsouth commented on GitHub (Apr 25, 2024): I had the same issue on a fresh install of Archlinux. I have never worked with ansible before so pardon if I make any bad reasoning but my issue was solved. ### [root@netbootxyz netboot.xyz]# ansible-playbook -i inventory site.yml gives the same error for me The error message says it's coming from line 6 of generate_disks_base.yml shown here ### [root@netbootxyz netboot.xyz]# cat roles/netbootxyz/tasks/generate_disks_base.yml ``` --- - name: Gathering facts ansible.builtin.setup: - name: Gather variables for each operating system ansible.builtin.include_vars: "{{ item }}" with_first_found: - "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml" - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml" - "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml" - "{{ ansible_distribution | lower }}.yml" - "{{ ansible_os_family | lower }}.yml" ``` The file names it is trying to find are generated from ansible.builtin.setup with the previous gathered facts step. On my system you can see one of those values here. ### [root@netbootxyz netboot.xyz]# ansible localhost -m ansible.builtin.setup | grep ansible_os_family ``` [WARNING]: No inventory was parsed, only implicit localhost is available "ansible_os_family": "Archlinux", ``` So if it's looking for a file named "ansible_os_family | lower" would reduce to "archlinux.yml", but in what path? ### [root@netbootxyz netboot.xyz]# find . -type f -name "*.yml" ``` . . . ./user_overrides.yml ./script/netbootxyz-overrides.yml ./roles/netbootxyz/vars/ubuntu.yml ./roles/netbootxyz/vars/debian.yml ./roles/netbootxyz/vars/redhat.yml ./roles/netbootxyz/vars/main.yml ``` I see some os families have their own ansible files, but not archlinux. They seem responsible for installing packages in apt and pip, so I created a similar file that was empty with the understanding I might have to do some manual installs later. ### .roles/netbootxyz/vars/archlinux.yml ``` --- netbootxyz_packages: [] pipxe_packages: [] ``` After creating this file and running the following command, it appears to work and NBPs are generated. ### [root@netbootxyz netboot.xyz]# ansible-playbook -i inventory site.yml ``` PLAY RECAP ******************************************************************************************************************************** localhost : ok=40 changed=16 unreachable=0 failed=0 skipped=22 rescued=0 ignored=0 ``` I do not know what a more robust archlinux.yml file should contain to support self hosting netbootxyz the stub I created was sufficient. The only packages I installed manually were ansible, apache, and git.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/netboot.xyz#455
No description provided.