#include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace leatherman::util; using namespace facter::facts::external; namespace facter { namespace facts { vector collection::get_external_fact_directories() const { vector directories; if (getuid()) { string home; if (environment::get("HOME", home)) { directories.emplace_back(home + "/.puppetlabs/opt/facter/facts.d"); directories.emplace_back(home + "/.facter/facts.d"); } } else { directories.emplace_back("/opt/puppetlabs/facter/facts.d"); directories.emplace_back("/etc/facter/facts.d"); directories.emplace_back("/etc/puppetlabs/facter/facts.d"); } return directories; } vector> collection::get_external_resolvers() { vector> resolvers; resolvers.emplace_back(new text_resolver()); resolvers.emplace_back(new yaml_resolver()); resolvers.emplace_back(new json_resolver()); // The execution resolver should go last as it doesn't check file extensions resolvers.emplace_back(new execution_resolver()); return resolvers; } }} // namespace facter::facts