Templates

Templates

syntropynet.syntropy.syntropy_template

Configures Syntropy Networks using Network Configuration Jinja2 template file. The format of the template(Either YAML or JSON) is determined from the file extension.

Parameter Choices/Defaults Comments
api_token
string
API Authorization token string.
This parameter is required if SYNTROPY_API_TOKEN environment variable is not set.
api_url
string
URL Of the Platform API.
This parameter is required if SYNTROPY_API_SERVER environment variable is not set.
template_params
dictionary
Default:
{}
ID of the network. Has precedence before network name.
template_path
path / required
The local path of the Syntropy configuration template.
This must be the full path to the file, relative to the working directory. If using roles this may look
like roles/syntropy/files/config-example.yaml.

Example

- name: Create a Point to point network
      syntropy_template:
        template_path: "files/configuration.yaml"
        template_params:
          network_state: present
          root_services:
          - nginx
    - name: Delete the network
      syntropy_template:
        template_path: "files/configuration.yaml"
        template_params:
          network_state: absent
---
state: {{ network_state }}
topology: P2M
connections:
  nl-do-controller01:
    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: {{ root_services }}

Did this page help you?