Skip to content
This repository has been archived by the owner on Mar 1, 2020. It is now read-only.

ChrisMacNaughton/juju-interface-consul

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Consul-agent

This layer handles registering connections between consul-agents and clients

Usage

Requires

Consul clients require information to connect to a Consul instance, so this interface provides that communication layer.

This interface layer will set the following states, as appropriate:

  • {relation_name}.connected The relation has connected, but Consul may not have provided required configuration
  • {relation_name}.available The Consul charm has provided required configuration

A charm can get configuration like:

@when('consul.connected')
def setup(consul):
    render(
        source='config.hcl',
        target='/etc/my_charm/config.hcl',
        context={
            'address': consul.address,
            'port': consul.port
        }
    )