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

facter not detecting aws cloud provider on EC2 instance #2708

Open
edrude opened this issue Apr 30, 2024 · 3 comments
Open

facter not detecting aws cloud provider on EC2 instance #2708

edrude opened this issue Apr 30, 2024 · 3 comments
Labels
bug Something isn't working triaged Jira issue has been created for this

Comments

@edrude
Copy link

edrude commented Apr 30, 2024

Describe the Bug

facter is not detecting that my cloud provider is aws on a specific system

Expected Behavior

A clear and concise description of what you expected to happen.
facter -p cloud should return
{
provider => "aws"
}

Steps to Reproduce

Steps to reproduce the behavior:
This system has been around for years. It started as CentOS7, changed to RHEL7, then upgraded to RHEL8. I don't have clear steps to reproduce, but I suspect this may be coming up because of what virt-what is returning. I can see that virt-what returns the following on the EC2 instance that is not detecting aws cloud provider.

xen
xen-hvm
aws

Environment

Red Hat Enterprise Linux release 8.9 (Ootpa)
facter 4.6.1
virt-what 1.25
puppet 8.5.1

Additional Context

root$ facter -p cloud --debug
[2024-04-30 16:05:03.650960 ] INFO Facter - executed with command line: -p cloud --debug
[2024-04-30 16:05:03.651031 ] DEBUG Facter - Facter version: 4.6.1
[2024-04-30 16:05:03.651054 ] DEBUG Facter - blocking collection of ec2_userdata facts
[2024-04-30 16:05:03.651076 ] DEBUG Facter::FactManager - Resolving facts sequentially
[2024-04-30 16:05:03.651648 ] DEBUG Facter::FactLoader - Loading all internal facts
[2024-04-30 16:05:03.653063 ] DEBUG Facter::FactLoader - Loading custom facts
[2024-04-30 16:05:03.902397 ] DEBUG Facter::FactManager - resolving fact with user_query: aio_agent_version
[2024-04-30 16:05:03.906898 ] DEBUG Facter::FactManager - Searching fact: aio_agent_version in file: aio_agent_version.rb
[2024-04-30 16:05:03.907329 ] DEBUG Facter::FactManager - Searching fact: aio_agent_version in core facts and external facts
[2024-04-30 16:05:03.907367 ] DEBUG Facter::FactLoader - Loading all internal facts
[2024-04-30 16:05:03.909855 ] DEBUG Facter::QueryParser - List of resolvable facts: [#<Facter::SearchedFact:0x00007f0f8736aa18 @name="aio_agent_version", @fact_class=Facts::Linux::AioAgentVersion, @user_query="aio_agent_version", @type=:core, @file=nil>]
[2024-04-30 16:05:03.910073 ] DEBUG Facter::FactLoader - Loading external facts
[2024-04-30 16:05:03.910760 ] DEBUG Facter::FactManager - fact "aio_agent_version" has resolved to: 8.5.1
[2024-04-30 16:05:04.007301 ] DEBUG Facter::FactManager - resolving fact with user_query: os.name
[2024-04-30 16:05:04.012362 ] DEBUG Facter::FactManager - Searching fact: os.name in file: os.name.rb
[2024-04-30 16:05:04.013167 ] DEBUG Facter::FactManager - Searching fact: os.name in core facts and external facts
[2024-04-30 16:05:04.013206 ] DEBUG Facter::FactLoader - Loading all internal facts
[2024-04-30 16:05:04.015744 ] DEBUG Facter::QueryParser - List of resolvable facts: [#<Facter::SearchedFact:0x00007f0f8a056860 @name="os.name", @fact_class=Facts::Rhel::Os::Name, @user_query="os.name", @type=:core, @file=nil>]
[2024-04-30 16:05:04.016029 ] DEBUG Facter::FactLoader - Loading external facts
[2024-04-30 16:05:04.016115 ] DEBUG Facter::FactManager - fact "os.name" has resolved to: RedHat
[2024-04-30 16:05:04.016609 ] DEBUG Facter::FactManager - resolving fact with user_query: os.family
[2024-04-30 16:05:04.017221 ] DEBUG Facter::FactManager - Searching fact: os.family in file: os.family.rb
[2024-04-30 16:05:04.018028 ] DEBUG Facter::FactManager - Searching fact: os.family in core facts and external facts
[2024-04-30 16:05:04.018064 ] DEBUG Facter::FactLoader - Loading all internal facts
[2024-04-30 16:05:04.020309 ] DEBUG Facter::QueryParser - List of resolvable facts: [#<Facter::SearchedFact:0x00007f0f88a09990 @name="os.family", @fact_class=Facts::Rhel::Os::Family, @user_query="os.family", @type=:core, @file=nil>]
[2024-04-30 16:05:04.020406 ] DEBUG Facter::FactLoader - Loading external facts
[2024-04-30 16:05:04.020486 ] DEBUG Facter::FactManager - fact "os.family" has resolved to: RedHat
[2024-04-30 16:05:04.084780 ] DEBUG Facter::FactManager - resolving fact with user_query: os.release.full
[2024-04-30 16:05:04.089231 ] DEBUG Facter::FactManager - Searching fact: os.release.full in file: os.release.full.rb
[2024-04-30 16:05:04.090148 ] DEBUG Facter::FactManager - Searching fact: os.release.full in core facts and external facts
[2024-04-30 16:05:04.090185 ] DEBUG Facter::FactLoader - Loading all internal facts
[2024-04-30 16:05:04.093480 ] DEBUG Facter::QueryParser - List of resolvable facts: [#<Facter::SearchedFact:0x00007f0f8737ec48 @name="os.release", @fact_class=Facts::Rhel::Os::Release, @user_query="os.release.full", @type=:core, @file=nil>]
[2024-04-30 16:05:04.093768 ] DEBUG Facter::FactLoader - Loading external facts
[2024-04-30 16:05:04.093853 ] DEBUG Facter::FactManager - Searching fact: os.release.full in all custom facts
[2024-04-30 16:05:04.093886 ] DEBUG Facter::FactLoader - Loading custom facts
[2024-04-30 16:05:04.098519 ] DEBUG Facter::FactManager - fact "os.release" has resolved to: {"full"=>"8.9", "major"=>"8", "minor"=>"9"}
[2024-04-30 16:05:04.105809 ] DEBUG Facter::FactLoader - Loading external facts
[2024-04-30 16:05:04.106781 ] DEBUG Facter::QueryParser - List of resolvable facts: [#<Facter::SearchedFact:0x00007f0f889bf6b0 @name="cloud.provider", @fact_class=Facts::Linux::Cloud::Provider, @user_query="cloud", @type=:core, @file=nil>]
[2024-04-30 16:05:04.107176 ] DEBUG Facter::Core::Execution::Posix - Executing command: uname -m &&
            uname -n &&
            uname -p &&
            uname -r &&
            uname -s &&
            uname -v
[2024-04-30 16:05:04.116125 ] DEBUG Facter::Core::Execution::Posix - Executing command: virt-what
@edrude edrude added the bug Something isn't working label Apr 30, 2024
@mhashizume mhashizume added the triaged Jira issue has been created for this label Apr 30, 2024
Copy link

Migrated issue to FACT-3466

@joshcooper
Copy link
Contributor

joshcooper commented Aug 2, 2024

What is the output of:

which virt-what
$(which virt-what) --version
/opt/puppetlabs/puppet/bin/virt-what --version

On systems where the fact removes correctly, does virt-what return a single entry? Or multiple entries, perhaps in a different order? Is the same version of virt-what installed on all systems?

@edrude
Copy link
Author

edrude commented Aug 30, 2024

Sorry for the delay. I hope this helps.

root@failed ~$ facter -p cloud

root@failed ~$ which virt-what -a
/usr/sbin/virt-what
root@failed ~$ $(which virt-what) --version
1.25
root@failed ~$ /opt/puppetlabs/puppet/bin/virt-what --version
1.25
root@failed ~$ virt-what
xen
xen-hvm
aws
root@worked ~$ facter -p cloud
{
  provider => "aws"
}
root@worked ~$ which virt-what -a
/usr/sbin/virt-what
root@worked ~$ $(which virt-what) --version
1.25
root@worked ~$ /opt/puppetlabs/puppet/bin/virt-what --version
1.25
root@worked  ~$ virt-what
kvm
aws

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged Jira issue has been created for this
Projects
None yet
Development

No branches or pull requests

3 participants