#
# This environment generator is used to generate some sample composable role
# environment files.
#
environments:
  -
    name: composable-roles/monolithic-nonha
    title: Monolithic Controller Non-HA deployment
    description: |
      A Heat environment that can be used to deploy controller and compute
      services in an Non-HA configuration with SSL undercloud only and a
      flat network.
      This should be used with a roles_data.yaml containing the Controller,
      Compute and CephStorage roles.
      openstack overcloud roles generate -o ~/roles_data.yaml Controller Compute CephStorage
    files:
      overcloud.yaml:
        parameters:
          - ControllerHostnameFormat
          - ComputeHostnameFormat
          - CephStorageHostnameFormat
          - ControllerCount
          - ComputeCount
          - CephStorageCount
      puppet/services/time/ntp.yaml:
        parameters:
          - NtpServer
      sample-env-generator/composable-roles.yaml:
        parameters:
          - DnsServers
          - OvercloudControllerFlavor
          - OvercloudComputeFlavor
          - OvercloudCephStorageFlavor
    sample_values:
      ControllerCount: 1
      OvercloudControllerFlavor: control
      ComputeCount: 1
      OvercloudComputeFlavor: compute
      CephStorageCount: 1
      OvercloudCephStorageFlavor: ceph

  -
    name: composable-roles/monolithic-ha
    title: Monolithic Controller HA deployment
    description: |
      A Heat environment that can be used to deploy controller and compute
      services in an HA configuration with SSL everywhere and network
      isolation.
      This should be used with a roles_data.yaml containing the Controller,
      Compute and CephStorage roles.
      openstack overcloud roles generate -o ~/roles_data.yaml Controller Compute CephStorage
    files:
      overcloud.yaml:
        parameters:
          - ControllerHostnameFormat
          - ComputeHostnameFormat
          - CephStorageHostnameFormat
          - ControllerCount
          - ComputeCount
          - CephStorageCount
      puppet/services/time/ntp.yaml:
        parameters:
          - NtpServer
      sample-env-generator/composable-roles.yaml:
        parameters:
          - DnsServers
          - OvercloudControllerFlavor
          - OvercloudComputeFlavor
          - OvercloudCephStorageFlavor
    sample_values:
      ControllerCount: 3
      OvercloudControllerFlavor: control
      ComputeCount: 3
      OvercloudComputeFlavor: compute
      CephStorageCount: 1
      OvercloudCephStorageFlavor: ceph

  -
    name: composable-roles/standalone
    title: Controller HA deployment with standalone Database, Messaging and Networker nodes.
    description: |
      A Heat environment that can be used to deploy controller, database,
      messaging, networker and compute services in an HA configuration with SSL
      everywhere and network isolation.
      This should be used with a roles_data.yaml containing the
      ControllerOpenstack, Database, Messaging, Networker, Compute and
      CephStorage roles.
      openstack overcloud roles generate -o ~/roles_data.yaml ControllerOpenstack Database Messaging Networker Compute CephStorage
    files:
      overcloud.yaml:
        parameters:
          - ComputeHostnameFormat
          - CephStorageHostnameFormat
          - ComputeCount
          - CephStorageCount
      puppet/services/time/ntp.yaml:
        parameters:
          - NtpServer
      sample-env-generator/composable-roles.yaml:
        parameters:
          - ControllerOpenstackHostnameFormat
          - DnsServers
          - ControllerOpenstackCount
          - DatabaseCount
          - MessagingCount
          - NetworkerCount
          - OvercloudControllerOpenstackFlavor
          - OvercloudComputeFlavor
          - OvercloudCephStorageFlavor
          - OvercloudDatabaseFlavor
          - OvercloudMessagingFlavor
          - OvercloudNetworkerFlavor
    sample_values:
      ControllerOpenstackCount: 3
      OvercloudControllerOpenstackFlavor: control
      ComputeCount: 1
      OvercloudComputeFlavor: compute
      CephStorageCount: 1
      OvercloudCephStorageFlavor: ceph
      DatabaseCount: 3
      OvercloudDatabaseFlavor: db
      MessagingCount: 3
      OvercloudMessagingFlavor: messaging
      NetworkerCount: 2
      OvercloudNetworkerFlavor: networker


# NOTE(aschultz): So because these are dynamic based on the roles used, we
# do not currently define these in any heat files. So we're defining them here
# so that the sample env generator can still provide these configuration items
# in the generated config files.
parameters:
  DnsServers:
    default: ['8.8.8.8', '8,8.4.4']
    description: DNS servers to use for the Overcloud
    type: comma_delimited_list
  # Dynamic vars based on roles
  ControllerOpenstackCount:
    default: 0
    description: Number of ControllerOpenstack nodes
    type: number
  DatabaseCount:
    default: 0
    description: Number of Database nodes
    type: number
  MessagingCount:
    default: 0
    description: Number of Messaging nodes
    type: number
  NetworkerCount:
    default: 0
    description: Number of Networker nodes
    type: number
  ControllerOpenstackHostnameFormat:
    type: string
    description: >
      Format for ControllerOpenstack node hostnames
      Note %index% is translated into the index of the node, e.g 0/1/2 etc
      and %stackname% is replaced with the stack name e.g overcloud
    default: "%stackname%-controller-%index%"
  OvercloudControllerFlavor:
    default: control
    description: Name of the flavor for Controller nodes
    type: string
  OvercloudControllerOpenstackFlavor:
    default: control
    description: Name of the flavor for ControllerOpenstack nodes
    type: string
  OvercloudComputeFlavor:
    default: compute
    description: Name of the flavor for Compute nodes
    type: string
  OvercloudCephStorageFlavor:
    default: compute
    description: Name of the flavor for Ceph nodes
    type: string
  OvercloudDatabaseFlavor:
    default: database
    description: Name of the flavor for Database nodes
    type: string
  OvercloudMessagingFlavor:
    default: messaging
    description: Name of the flavor for Messaging nodes
    type: string
  OvercloudNetworkerFlavor:
    default: networker
    description: Name of the flavor for Networker nodes
    type: string