|
|
@ -37,7 +37,7 @@ This script can be run with the switches
|
|
|
|
--datacenter, to restrict the nodes to a single datacenter
|
|
|
|
--datacenter, to restrict the nodes to a single datacenter
|
|
|
|
--host to restrict the inventory to a single named node. (requires datacenter config)
|
|
|
|
--host to restrict the inventory to a single named node. (requires datacenter config)
|
|
|
|
|
|
|
|
|
|
|
|
The configuration for this plugin is read from a consul.ini file located in the
|
|
|
|
The configuration for this plugin is read from a consul_io.ini file located in the
|
|
|
|
same directory as this inventory script. All config options in the config file
|
|
|
|
same directory as this inventory script. All config options in the config file
|
|
|
|
are optional except the host and port, which must point to a valid agent or
|
|
|
|
are optional except the host and port, which must point to a valid agent or
|
|
|
|
server running the http api. For more information on enabling the endpoint see.
|
|
|
|
server running the http api. For more information on enabling the endpoint see.
|
|
|
@ -420,8 +420,11 @@ class ConsulConfig(dict):
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
def read_settings(self):
|
|
|
|
def read_settings(self):
|
|
|
|
''' Reads the settings from the consul.ini file '''
|
|
|
|
''' Reads the settings from the consul_io.ini file (or consul.ini for backwards compatibility)'''
|
|
|
|
config = ConfigParser.SafeConfigParser()
|
|
|
|
config = ConfigParser.SafeConfigParser()
|
|
|
|
|
|
|
|
if os.path.isfile(os.path.dirname(os.path.realpath(__file__)) + '/consul_io.ini'):
|
|
|
|
|
|
|
|
config.read(os.path.dirname(os.path.realpath(__file__)) + '/consul_io.ini')
|
|
|
|
|
|
|
|
else:
|
|
|
|
config.read(os.path.dirname(os.path.realpath(__file__)) + '/consul.ini')
|
|
|
|
config.read(os.path.dirname(os.path.realpath(__file__)) + '/consul.ini')
|
|
|
|
|
|
|
|
|
|
|
|
config_options = ['host', 'token', 'datacenter', 'servers_suffix',
|
|
|
|
config_options = ['host', 'token', 'datacenter', 'servers_suffix',
|
|
|
|