Forge Home

10,187 downloads

10,187 latest version

1.9 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.0.1 (latest)
released Jan 13th 2013

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'hastexo-location', '0.0.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add hastexo-location
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install hastexo-location --version 0.0.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

hastexo/location — version 0.0.1 Jan 13th 2013

location

This module contacts an on-line geolocation service and stores several facts about the geographical location of the node.

Warning

Do not retrieve facts from untrusted sources. location does not do any sanity checking on the retrieved location information.

By default, this module attempts to retrieve the node's location using the JSON service at http://freegeoip.net. This free service is limited to 1000 requests per hour, so you should not use it in massively elastic or particularly large environments.

However, the software running FreeGeoIP is freely available on GitHub, enabling you to run your own geo-location web service if you so choose.

Example

To fetch geo-location information from FreeGeoIP, just put the following in your manifest:

include location

This will fetch your node's locative information from http://freegeoip.net/json/ and store it in /etc/facter/facts.d/location.json.

If you run your own service, or want to specify a non-default filename for the downloaded facts, you can do so as follows:

class { 'location':
    url => 'http://location.example.com/json/',
    filename => 'whereami.json'
}

Note that in order to be properly parsed by facter-dot-d, Your filename must end in .json.

Normally, the lookup will occur only once for every node. In order to purge and refresh a node's location information, delete the fact file and wait for the next agent run.

License

ASL 2.0.

Contact

Contact puppetforge@hastexo.com for any comments and questions about this module.

Support

Please report issues on GitHub.