Ansible facts and Armbian

Recommended Posts

As an ansible neophyte, I'm looking through the 'ansible facts' trying to figure out how to positively identify an Armbian system, with the goal of contributing a patch to the k3s project to improve support for Armbian.


Toward the end of the k3s-ansible playbook, they try to write some kernel options to a file in /boot. According to the comments, they've identified by Armbian machine as Ubuntu. At any rate, Armbian seems to want these flags in /boot/armbianEnv.txt, and the file ansible wants to modify doesn't exist so the update aborts:


fatal: [t4]: FAILED! => {"changed": false, "msg": "Destination /boot/firmware/cmdline.txt does not exist !", "rc": 257}


Looking at the ansible facts for the kernel (the motd says, "Welcome to Armbian Focal with Linux 5.4.45-sunxi64"), I don't see any entries that just come right out and say "Armbian". I'm not sure if it's common to look for subtle cues, or if this means that Armbian should be changing some metadata to announce itself? Or alternatively, why does Armbian use a different filename than Ubuntu?


What do you folks think? Any suggestions or pointers?





Link to post
Share on other sites
Donate and support the project!

Grovelling through k3s's playbook a and digging through the Armbian filesystem a little bit, I've figured out that Armbian reports:



lsb_release -a

No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 20.04 LTS
Release:    20.04
Codename:    focal


Whereas some folks on the Internet report that Rasbian returns:



lsb_release -a

No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10.0 (n/a)


It seems like it might work better to follow Raspbian's pattern. It would give me something for ansible to sink its teeth into (ansible does not seem to report Distributor ID, which is a shame)


Would it hurt anything to change this behavior? I haven't built a kernel in forever, let alone filed a patch to a distribution. How would I go about getting that to happen?



Link to post
Share on other sites
3 minutes ago, Tido said:


Not sure how that helps with ansible. I believe the metadata is gathered and then the logic runs on the remote server, does it not?


It looks like everything in Armbian that says it's Armbian are in files with 'Armbian' in the name, from /boot to /etc.  Which of course general purpose Linux tools will not be looking for.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.