environments:
  -
    name: enable-designate
    title: Enable Designate Service
    description: |
      EXPERIMENTAL: This service is not considered ready for production and
      should only be used for development and test purposes at this time.

      This environment enables the Designate services.  One of the
      designate-config* environment files must also be included.
    # FIXME(bnemec): files should not be a required key.
    files: {}
    resource_registry:
      OS::TripleO::Services::DesignateApi: ../deployment/experimental/designate/designate-api-container-puppet.yaml
      OS::TripleO::Services::DesignateCentral: ../deployment/experimental/designate/designate-central-container-puppet.yaml
      OS::TripleO::Services::DesignateProducer: ../deployment/experimental/designate/designate-producer-container-puppet.yaml
      OS::TripleO::Services::DesignateWorker: ../deployment/experimental/designate/designate-worker-container-puppet.yaml
      OS::TripleO::Services::DesignateMDNS: ../deployment/experimental/designate/designate-mdns-container-puppet.yaml
  -
    name: designate-config
    title: Configure Designate Parameters
    description: |
      Sample configuration parameters for Designate.  Requires the
      enable-designate environment.
    files:
      deployment/neutron/neutron-plugin-ml2.yaml:
        parameters:
          - NeutronPluginExtensions
      deployment/neutron/neutron-dhcp-container-puppet.yaml:
        parameters:
          - NeutronEnableInternalDNS
      deployment/experimental/designate/designate-central-container-puppet.yaml:
        parameters:
          - DesignatePools
    sample_values:
      NeutronPluginExtensions: qos,port_security,dns
      NeutronEnableInternalDNS: True
      DesignatePools: |-
        |
            - name: default
              # The name is immutable. There will be no option to change the name after
              # creation and the only way will to change it will be to delete it
              # (and all zones associated with it) and recreate it.
              description: Default Pool

              attributes: {}

              # List out the NS records for zones hosted within this pool
              # This should be a record that is created outside of designate, that
              # points to the public IP of the controller node.
              ns_records:
                - hostname: ns1-1.example.org.
                  priority: 1

              # List out the nameservers for this pool. These are the actual BIND servers.
              # We use these to verify changes have propagated to all nameservers.
              nameservers:
                - host: 10.0.0.51
                  port: 53

              # List out the targets for this pool. For BIND there will be one
              # entry for each BIND server, as we have to run rndc command on each server
              targets:
                - type: bind9
                  description: BIND9 Server 1

                  # List out the designate-mdns servers from which BIND servers should
                  # request zone transfers (AXFRs) from.
                  # This should be the IP of the controller node.
                  # If you have multiple controllers you can add multiple masters
                  # by running designate-mdns on them, and adding them here.
                  masters:
                    - host: 10.0.0.51
                      port: 5354

                  # BIND Configuration options
                  options:
                    host: 10.0.0.51
                    port: 53
                    rndc_host: 172.17.0.251
                    rndc_port: 953
                    rndc_key_file: /etc/rndc.key
    children:
      -
        name: designate-config-ha
        title: Configure Designate Parameters for HA
        description: |
          Sample configuration parameters for Designate that are appropriate
          for an HA deployment.  Requires the enable-designate environment.
        sample_values:
          NeutronPluginExtensions: qos,port_security,dns
          NeutronEnableInternalDNS: True
          DesignatePools: |-
            |
                - name: default
                  # The name is immutable. There will be no option to change the name after
                  # creation and the only way will to change it will be to delete it
                  # (and all zones associated with it) and recreate it.
                  description: Default Pool

                  attributes: {}

                  # List out the NS records for zones hosted within this pool
                  # This should be a record that is created outside of designate, that
                  # points to the public IP of the controller node.
                  ns_records:
                    - hostname: ns1-1.example.org.
                      priority: 1
                    - hostname: ns1-2.example.org.
                      priority: 2
                    - hostname: ns1-3.example.org.
                      priority: 3

                  # List out the nameservers for this pool. These are the actual BIND servers.
                  # We use these to verify changes have propagated to all nameservers.
                  nameservers:
                    - host: 10.0.0.51
                      port: 53
                    - host: 10.0.0.52
                      port: 53
                    - host: 10.0.0.53
                      port: 53

                  # List out the targets for this pool. For BIND there will be one
                  # entry for each BIND server, as we have to run rndc command on each server
                  targets:
                    - type: bind9
                      description: BIND9 Server 1

                      # List out the designate-mdns servers from which BIND servers should
                      # request zone transfers (AXFRs) from.
                      # This should be the IP of the controller node.
                      # If you have multiple controllers you can add multiple masters
                      # by running designate-mdns on them, and adding them here.
                      masters:
                        - host: 10.0.0.51
                          port: 5354
                        - host: 10.0.0.52
                          port: 5354
                        - host: 10.0.0.53
                          port: 5354

                      # BIND Configuration options
                      options:
                        host: 10.0.0.51
                        port: 53
                        rndc_host: 172.17.0.251
                        rndc_port: 953
                        rndc_key_file: /etc/rndc.key
                    - type: bind9
                      description: BIND9 Server 2

                      # List out the designate-mdns servers from which BIND servers should
                      # request zone transfers (AXFRs) from.
                      # This should be the IP of the controller node.
                      # If you have multiple controllers you can add multiple masters
                      # by running designate-mdns on them, and adding them here.
                      masters:
                        - host: 10.0.0.51
                          port: 5354
                        - host: 10.0.0.52
                          port: 5354
                        - host: 10.0.0.53
                          port: 5354

                      # BIND Configuration options
                      options:
                        host: 10.0.0.52
                        port: 53
                        rndc_host: 172.17.0.252
                        rndc_port: 953
                        rndc_key_file: /etc/rndc.key
                    - type: bind9
                      description: BIND9 Server 3

                      # List out the designate-mdns servers from which BIND servers should
                      # request zone transfers (AXFRs) from.
                      # This should be the IP of the controller node.
                      # If you have multiple controllers you can add multiple masters
                      # by running designate-mdns on them, and adding them here.
                      masters:
                        - host: 10.0.0.51
                          port: 5354
                        - host: 10.0.0.52
                          port: 5354
                        - host: 10.0.0.53
                          port: 5354

                      # BIND Configuration options
                      options:
                        host: 10.0.0.53
                        port: 53
                        rndc_host: 172.17.0.253
                        rndc_port: 953
                        rndc_key_file: /etc/rndc.key
