Command line to show life cycle environment

I just finished patching the servers in our bottom life cycle environment. I then was checking all of those servers from our salt master for the installed version of a package. I found a couple that were behind the rest. I got on our satellite server and ran a hammer host list and saw that these servers were in the top life cycle environment and not the bottom.
Is there a command from a server I can run to show what life cycle environment it is enrolled in? I can’t seem to find the information with subcription-manager status.

Expected outcome: Have a command to show the current life cycle environment.

Foreman and Proxy versions: foreman 3.0.1-1, katello 4.2.1-1

Foreman and Proxy plugin versions:

Distribution and version: CentOS 7.9

I think I figured out an indirect answer. If I run

subscription-manager repos | grep '^Repo URL'

I can see by the directory above the composite content view which life cycle it is using. Not a direct answer, but I can what I need from that.

You can also use subscription-manager identity, the field “environment name” in the output will be Lifecycle Environment/Content View
Hope this helps :slight_smile:

Yes. That is simpler than what I came up with. Thanks!