Lavaburn / puppet-mikrotik

Puppet Module for managing Mikrotik Devices
Apache License 2.0
9 stars 2 forks source link

Advanced config #11

Open philomory opened 3 years ago

philomory commented 3 years ago

This PR allows moving the puppet device configuration to an external JSON file; e.g. you can (optionally) specify the following in device.conf:

[mikrotik.example.com]
type mikrotik
url file:///etc/puppetlabs/puppet/devices/mikrotik.example.com.json

... and then in mikrotik.example.com.json include the following:

{
  "host": "10.1.1.1",
  "user": "puppet",
  "password": "MYSECRETPASSWORD",
  "use_ssl": true
}

The supported options are, everything that MTik::Connection.new() accepts, plus include_ec2_facts. Setting include_ec2_facts to true will instruct the module to gather a limited amount of ec2_metadata facts during fact collection via /tool/fetch of http://169.254.169.254/latest/meta-data/.