0
hinkley

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?

 

Thanks!

 

 

Share this post


Link to post
Share on other sites
Want Armbian t-shirt or a cup?

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

 

Quote

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:

 

Quote

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?

 

 

Share this post


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.

Share this post


Link to post
Share on other sites

@hinkley

Changing how we interact with the LSB release info would be an architectural decision we'd have to investigate.

 

My suggested approach for now would be to write a custom facts module that looks for and parses /etc/armbian-release and store it in the library folder of your role.

Share this post


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.

Guest
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.

Loading...
0