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

Ansible Ubuntu Prepare playbook Raspberry Pi check tasks throw fatal error #251

Closed
mattsoldo opened this issue Mar 6, 2022 · 9 comments
Closed

Comments

@mattsoldo
Copy link
Contributor

Details

What steps did you take and what happened:

Running task ansible:playbook:ubuntu-prepare, all steps of setup working fine prior. Using this with nodes that are not Raspberry Pis.

What did you expect to happen:

Expected Raspberry Pi check run successfully to show that nodes are no Pis.

Anything else you would like to add:

Additional Information:

Output:

TASK [ubuntu : Check if Raspberry Pi] ***************************************************************************************************************************************************
fatal: [k8s-2]: FAILED! => changed=true 
  cmd:
  - grep
  - -q
  - Raspberry Pi
  - /proc/cpuinfo
  delta: '0:00:00.019747'
  end: '2022-03-06 21:54:00.526425'
  msg: non-zero return code
  rc: 1
  start: '2022-03-06 21:54:00.506678'
  stderr: ''
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>
...ignoring
fatal: [k8s-0]: FAILED! => changed=true 
  cmd:
  - grep
  - -q
  - Raspberry Pi
  - /proc/cpuinfo
  delta: '0:00:00.020600'
  end: '2022-03-06 21:54:00.622424'
  msg: non-zero return code
  rc: 1
  start: '2022-03-06 21:54:00.601824'
  stderr: ''
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>
...ignoring
fatal: [k8s-1]: FAILED! => changed=true 
  cmd:
  - grep
  - -q
  - Raspberry Pi
  - /proc/cpuinfo
  delta: '0:00:00.019085'
  end: '2022-03-06 21:54:00.632873'
  msg: non-zero return code
  rc: 1
  start: '2022-03-06 21:54:00.613788'
  stderr: ''
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>
...ignoring

@onedr0p
Copy link
Owner

onedr0p commented Mar 7, 2022

If you run that grep command directly on the hosts what is the output?

@mattsoldo
Copy link
Contributor Author

mattsoldo commented Mar 7, 2022

The grep command produces no output:

$ grep -q  "Raspberry Pi" /proc/cpuinfo
$ grep "Raspberry Pi" /proc/cpuinfo
$ 

@onedr0p
Copy link
Owner

onedr0p commented Mar 7, 2022

Very interesting, that should gracefully error... Maybe comment out this code so it works, or try to debug it. I haven't had any other reports of this issue happening so I'm curious what's causing it. If you find it out please feel free to open a PR with a fix. Thanks!

https://github.com/k8s-at-home/template-cluster-k3s/blob/main/provision/ansible/roles/ubuntu/tasks/packages.yml#L40-L57

@onedr0p
Copy link
Owner

onedr0p commented Apr 19, 2022

Going to close this issue, please reopen if you're still stuck.

@onedr0p onedr0p closed this as completed Apr 19, 2022
@ben-hampson
Copy link

I had the exact same issue on an Ubuntu 22.04 LTS VM.

TASK [ubuntu : Check if Raspberry Pi] ************************************************************************************************
fatal: [k8s-0]: FAILED! => changed=true 
  cmd:
  - grep
  - -q
  - Raspberry Pi
  - /proc/cpuinfo
  delta: '0:00:00.003110'
  end: '2022-04-30 20:59:34.763862'
  msg: non-zero return code
  rc: 1
  start: '2022-04-30 20:59:34.760752'
  stderr: ''
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>
...ignoring

TASK [ubuntu : Install raspberry specific packages for Ubuntu 21 or greater] *********************************************************
FAILED - RETRYING: [k8s-0]: Install raspberry specific packages for Ubuntu 21 or greater (5 retries left).
FAILED - RETRYING: [k8s-0]: Install raspberry specific packages for Ubuntu 21 or greater (4 retries left).
FAILED - RETRYING: [k8s-0]: Install raspberry specific packages for Ubuntu 21 or greater (3 retries left).
FAILED - RETRYING: [k8s-0]: Install raspberry specific packages for Ubuntu 21 or greater (2 retries left).
FAILED - RETRYING: [k8s-0]: Install raspberry specific packages for Ubuntu 21 or greater (1 retries left).
fatal: [k8s-0]: FAILED! => changed=false 
  attempts: 5
  msg: No package matching 'linux-modules-extra-raspi' is available

ssh-ing in and running the grep returns nothing.

@onedr0p
Copy link
Owner

onedr0p commented Apr 30, 2022

Seems like something might have changed with 22.04, as No package matching 'linux-modules-extra-raspi' is available

Maybe it was changed to this package?

https://launchpad.net/ubuntu/jammy/+source/linux-raspi

@onedr0p
Copy link
Owner

onedr0p commented May 1, 2022

I have fixed this issue, meaning the code doesn't exist anymore for this check or installing linux-modules-extra-raspi. If anyone has an idea if this is still needed on 22.04, please open a PR 🙏🏼

@onedr0p
Copy link
Owner

onedr0p commented May 3, 2022

Ok, after some confirmation I believe this is really fixed. d10800e

@onedr0p
Copy link
Owner

onedr0p commented May 6, 2022

Closing issue, this should be fixed now and forever.

@onedr0p onedr0p closed this as completed May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants