Complex Topologies

Complex Topologies

Creating complex topologies

It is possible to create complex topologies that are outside of either P2P, P2M, or MESH. However, keep in mind, that exporting such networks using P2P or MESH topology would either leave out endpoints or add nonexisting connections respectively from the configuration YAML file since the aforementioned topologies lack the required expressiveness to describe complex networks.

---
state: present
topology: P2P
connections:
  nl-altushost-nat01.syntropystack.com:
    connect_to:
      AccurateHardtofind-VM:
        type: endpoint
    state: present
    type: endpoint
    services: 
      - nginx
  AccurateHardtofind-VM:
    connect_to:
      de-readydedis-nat05.syntropystack.com:
        # In case there are multiple endpoints with the same name
        # you can use endpoint id parameter.
        # Note, however, that creating endpoints with the same name
        # is not advised.
        id: 437
        type: endpoint
    state: present
    type: endpoint
  de-readydedis-nat05.syntropystack.com:
    id: 437
    type: endpoint
    connect_to:
      MushyWry-VM:
        type: endpoint
  MushyWry-VM:
    type: endpoint
    connect_to:
      AccurateHardtofind-VM:
        type: endpoint
        state: absent

---
state: present
topology: MESH
connections:
  ca-libracloud-nat06.syntropystack.com:
    id: 202
    services: []
    state: present
    type: endpoint
  ca-lunanode-nat02.syntropystack.com:
    id: 196
    services: []
    state: present
    type: endpoint
  ca-oneprovider-nat06.syntropystack.com:
    id: 199
    services: []
    state: present
    type: endpoint
  povilas:
    id: 210
    services: []
    type: endpoint
  AccurateHardtofind-VM:
    state: present
    type: endpoint

---
state: present
topology: P2M
connections:
  MushyWry-VM:
    connect_to:
      uk-khanwebhost-nat02.syntropystack.com:
        type: endpoint
        services:
          - most-useless-service
          - service-that-is-not-there
      us-khanwebhost-nat04.syntropystack.com:
        state: present
        type: endpoint
        services:
          - iperf
      fr-khanwebhost-nat01.syntropystack.com:
        state: present
        type: endpoint
        services:
          - nginx
          - useless-app
      de-khanwebhost-nat03.syntropystack.com:
        state: present
        type: endpoint
    state: present
    type: endpoint
    services: 
    - postgres
    - mongo

Exported configuration file

Note that the resulting configuration file contains only one document describing the whole network. Keep this in mind if you'd like to diff the export with the original configuration file.

connections:
  AccurateHardtofind-VM:
    connect_to:
      ca-libracloud-nat06.syntropystack.com:
        id: 202
        services: []
        state: present
        type: endpoint
      ca-lunanode-nat02.syntropystack.com:
        id: 196
        services: []
        state: present
        type: endpoint
      ca-oneprovider-nat06.syntropystack.com:
        id: 199
        services: []
        state: present
        type: endpoint
      de-readydedis-nat05.syntropystack.com:
        id: 437
        services: []
        state: present
        type: endpoint
      nl-do-controller01:
        id: 9
        services:
        - postgres
        - mongo
        state: present
        type: endpoint
      povilas:
        id: 210
        services: []
        state: present
        type: endpoint
    id: 50
    services: []
    state: present
    type: endpoint
  MushyWry-VM:
    connect_to:
      de-khanwebhost-nat03.syntropystack.com:
        id: 5
        services: []
        state: present
        type: endpoint
      de-readydedis-nat05.syntropystack.com:
        id: 437
        services: []
        state: present
        type: endpoint
      fr-khanwebhost-nat01.syntropystack.com:
        id: 641
        services: []
        state: present
        type: endpoint
      uk-khanwebhost-nat02.syntropystack.com:
        id: 640
        services: []
        state: present
        type: endpoint
      us-khanwebhost-nat04.syntropystack.com:
        id: 306
        services: []
        state: present
        type: endpoint
    id: 242
    services: []
    state: present
    type: endpoint
  ca-libracloud-nat06.syntropystack.com:
    connect_to:
      AccurateHardtofind-VM:
        id: 50
        services: []
        state: present
        type: endpoint
      ca-lunanode-nat02.syntropystack.com:
        id: 196
        services: []
        state: present
        type: endpoint
      ca-oneprovider-nat06.syntropystack.com:
        id: 199
        services: []
        state: present
        type: endpoint
      povilas:
        id: 210
        services: []
        state: present
        type: endpoint
    id: 202
    services: []
    state: present
    type: endpoint
  ca-lunanode-nat02.syntropystack.com:
    connect_to:
      AccurateHardtofind-VM:
        id: 50
        services: []
        state: present
        type: endpoint
      ca-libracloud-nat06.syntropystack.com:
        id: 202
        services: []
        state: present
        type: endpoint
      ca-oneprovider-nat06.syntropystack.com:
        id: 199
        services: []
        state: present
        type: endpoint
      povilas:
        id: 210
        services: []
        state: present
        type: endpoint
    id: 196
    services: []
    state: present
    type: endpoint
  ca-oneprovider-nat06.syntropystack.com:
    connect_to:
      AccurateHardtofind-VM:
        id: 50
        services: []
        state: present
        type: endpoint
      ca-libracloud-nat06.syntropystack.com:
        id: 202
        services: []
        state: present
        type: endpoint
      ca-lunanode-nat02.syntropystack.com:
        id: 196
        services: []
        state: present
        type: endpoint
      povilas:
        id: 210
        services: []
        state: present
        type: endpoint
    id: 199
    services: []
    state: present
    type: endpoint
  de-readydedis-nat05.syntropystack.com:
    connect_to:
      AccurateHardtofind-VM:
        id: 50
        services: []
        state: present
        type: endpoint
      MushyWry-VM:
        id: 242
        services: []
        state: present
        type: endpoint
    id: 437
    services: []
    state: present
    type: endpoint
  povilas:
    connect_to:
      AccurateHardtofind-VM:
        id: 50
        services: []
        state: present
        type: endpoint
      ca-libracloud-nat06.syntropystack.com:
        id: 202
        services: []
        state: present
        type: endpoint
      ca-lunanode-nat02.syntropystack.com:
        id: 196
        services: []
        state: present
        type: endpoint
      ca-oneprovider-nat06.syntropystack.com:
        id: 199
        services: []
        state: present
        type: endpoint
    id: 210
    services: []
    state: present
    type: endpoint
state: present
topology: P2M

Did this page help you?