Add information about /etc/os-release (#212)

This commit is contained in:
Tim Byrne 2020-06-30 16:30:31 -05:00
parent 545945c714
commit 1de83b4007
No known key found for this signature in database
GPG Key ID: 14DB4FC2465A4B12
2 changed files with 8 additions and 2 deletions

View File

@ -29,7 +29,7 @@ be omitted. Most attributes can be abbreviated as a single letter.
| - | - |
| `template`, `t` | Valid when the value matches a supported template processor. See the [Templates](/docs/templates) section for more details.|
| `user`, `u` | Valid if the value matches the current user. Current user is calculated by running <code>id&nbsp;&#8209;u&nbsp;&#8209;n</code>. |
| `distro`, `d` | Valid if the value matches the distro. Distro is calculated by running <code>lsb_release&nbsp;&#8209;si</code>. |
| `distro`, `d` | Valid if the value matches the distro. Distro is calculated by running <code>lsb_release&nbsp;&#8209;si</code> or inspecting <code>/etc/os-release</code> |
| `os`, `o` | Valid if the value matches the OS. OS is calculated by running <code>uname&nbsp;&#8209;s</code>. <sup>*</sup> |
| `class`, `c` | Valid if the value matches the local.class configuration. Class must be manually set using <code>yadm&nbsp;config&nbsp;local.class&nbsp;&lt;class&gt;</code>. |
|`hostname`, `h`|Valid if the value matches the short hostname. Hostname is calculated by running `hostname`, and trimming off any domain.|
@ -37,6 +37,9 @@ be omitted. Most attributes can be abbreviated as a single letter.
<sub><sup>*
The OS for "Windows Subsystem for Linux" is reported as "WSL", even though uname identifies as "Linux".
<br/>
*
If `lsb_release` is not available, "distro" will be the ID specified in `/etc/os-release`.
</sup></sub>
You may use any number of conditions, in any order. An alternate will only be

View File

@ -39,7 +39,7 @@ When template processors run, they will be provided the following set of data.
| Default (built-in) | Jinja | Description | Source |
| - | - | - | - |
| `yadm.class` | `YADM_CLASS` | Locally defined yadm class | <code>yadm&nbsp;config&nbsp;local.class</code> |
| `yadm.distro` | `YADM_DISTRO` | Distribution | <code>lsb_release&nbsp;&#8209;si</code> |
| `yadm.distro` | `YADM_DISTRO` | Distribution | <code>lsb_release&nbsp;&#8209;si</code><br/>or <code>/etc/os-release</code> |
| `yadm.hostname` | `YADM_HOSTNAME` | Hostname | `hostname` (without domain) |
| `yadm.os` | `YADM_OS` | Operating system | <code>uname&nbsp;&#8209;s</code> <sup>*</sup> |
| `yadm.user` | `YADM_USER` | Current user | <code>id&nbsp;&#8209;u&nbsp;&#8209;n</code> |
@ -47,6 +47,9 @@ When template processors run, they will be provided the following set of data.
<sub><sup>*
The OS for "Windows Subsystem for Linux" is reported as "WSL", even though uname identifies as "Linux".
<br/>
*
If `lsb_release` is not available, "distro" will be the ID specified in `/etc/os-release`.
</sup></sub>
## Supported template processors