<commit_before>heat_template_version: 2013-05-23

description: |
  This is a Heat template to deploy a redis cluster on Rackspace Cloud Servers
  along with a sentinel on each slave to automate promotion of a new master
  when the existing one fails.


parameters:

  server_flavor:
    description: Rackspace Cloud Server flavor
    type: string
    default: 1 GB Performance
    constraints:
    - allowed_values:
      - 1 GB Performance
      - 2 GB Performance
      - 4 GB Performance
      - 8 GB Performance
      - 15 GB Performance
      - 30 GB Performance
      - 512MB Standard Instance
      - 1GB Standard Instance
      - 2GB Standard Instance
      - 4GB Standard Instance
      - 8GB Standard Instance
      - 15GB Standard Instance
      - 30GB Standard Instance
      description: |
        Must be a valid Rackspace Cloud Server flavor for the region you have
        selected to deploy into.

  image_name:
    label: Server Image
    description: Operating system to use for created servers
    type: string
    default: Ubuntu 12.04 LTS (Precise Pangolin)
    constraints:
    - allowed_values:
      - Ubuntu 12.04 LTS (Precise Pangolin)
      - Ubuntu 13.10 (Saucy Salamander)
      description: Must be a supported operating system.

  redis_version:
    description: version of redis to install
    type: string
    default: 2.8.9

  redis_master_hostname:
    description: Hostname for nominal redis master
    type: string
    default: redis

  redis_slave_hostname:
    description: Hostname for the slaves
    type: string
    default: redis

  ssh_keypair_name:
    description: Nova keypair name for ssh access to the servers
    type: string
    default: redis

  slave_node_count:
    description: Number of slave nodes to create
    type: number
    default: 2
    constraints:
      - range: { min: 1 }

  slave_server_hostname:
    description: hostname for slave servers
    type: string
    default: redis-slave

  redis_port:
    description: port for redis servers to listen on
    type: number
    default: 6379

  sentinel_port:
    description: port for sentinels to listen on
    type: number
    default: 26379

resources:

  ssh_key:
    type: OS::Nova::KeyPair
    properties:
      name: { get_param: ssh_keypair_name }
      save_private_key: true

  redis_password:
    type: OS::Heat::RandomString
    properties:
      length: 32
      sequence: lettersdigits

  redis_master:
    type: Rackspace::Cloud::Server
    depends_on: ssh_key
    properties:
      name: { get_param: redis_master_hostname }
      flavor: { get_param: server_flavor }
      image: { get_param: image_name }
      key_name: { get_resource: ssh_key }

  redis_master_config:
    type: OS::Heat::ChefSolo
    depends_on: redis_master
    properties:
      username: root
      private_key: { get_attr: [ssh_key, private_key] }
      host: { get_attr: [redis_master, accessIPv4] }
      kitchen: https://github.com/rackspace-orchestration-templates/redis-sentinel.git
      node:
        run_list: [ "recipe[apt]",
                    "recipe[build-essential]",
                    "recipe[rax-redis::config_slave_sentinel]",
                    "recipe[its::broken]" ]
        redisio:
          default_settings:
            requirepass: { get_attr: [redis_password, value] }
          servers:
            - name: master
              port: { get_param: redis_port }
          sentinels:
            - sentinel_port: { get_param: sentinel_port }
              port:          { get_param: sentinel_port }
              name: 'cluster'
              master_ip:     { get_attr: [redis_master, accessIPv4] }
              master_port:   { get_param: redis_port }
              auth-pass:     { get_attr: [redis_password, value] }
              logfile: /var/log/sentinel.log
          version: { get_param: redis_version }

  redis_slave_nodes:
    type: "OS::Heat::ResourceGroup"
    depends_on: redis_master
    properties:<commit_msg>remove testing runlist entries so stack actually builds<commit_after>heat_template_version: 2013-05-23

description: |
  This is a Heat template to deploy a redis cluster on Rackspace Cloud Servers
  along with a sentinel on each slave to automate promotion of a new master
  when the existing one fails.


parameters:

  server_flavor:
    description: Rackspace Cloud Server flavor
    type: string
    default: 1 GB Performance
    constraints:
    - allowed_values:
      - 1 GB Performance
      - 2 GB Performance
      - 4 GB Performance
      - 8 GB Performance
      - 15 GB Performance
      - 30 GB Performance
      - 512MB Standard Instance
      - 1GB Standard Instance
      - 2GB Standard Instance
      - 4GB Standard Instance
      - 8GB Standard Instance
      - 15GB Standard Instance
      - 30GB Standard Instance
      description: |
        Must be a valid Rackspace Cloud Server flavor for the region you have
        selected to deploy into.

  image_name:
    label: Server Image
    description: Operating system to use for created servers
    type: string
    default: Ubuntu 12.04 LTS (Precise Pangolin)
    constraints:
    - allowed_values:
      - Ubuntu 12.04 LTS (Precise Pangolin)
      - Ubuntu 13.10 (Saucy Salamander)
      description: Must be a supported operating system.

  redis_version:
    description: version of redis to install
    type: string
    default: 2.8.9

  redis_master_hostname:
    description: Hostname for nominal redis master
    type: string
    default: redis

  redis_slave_hostname:
    description: Hostname for the slaves
    type: string
    default: redis

  ssh_keypair_name:
    description: Nova keypair name for ssh access to the servers
    type: string
    default: redis

  slave_node_count:
    description: Number of slave nodes to create
    type: number
    default: 2
    constraints:
      - range: { min: 1 }

  slave_server_hostname:
    description: hostname for slave servers
    type: string
    default: redis-slave

  redis_port:
    description: port for redis servers to listen on
    type: number
    default: 6379

  sentinel_port:
    description: port for sentinels to listen on
    type: number
    default: 26379

resources:

  ssh_key:
    type: OS::Nova::KeyPair
    properties:
      name: { get_param: ssh_keypair_name }
      save_private_key: true

  redis_password:
    type: OS::Heat::RandomString
    properties:
      length: 32
      sequence: lettersdigits

  redis_master:
    type: Rackspace::Cloud::Server
    depends_on: ssh_key
    properties:
      name: { get_param: redis_master_hostname }
      flavor: { get_param: server_flavor }
      image: { get_param: image_name }
      key_name: { get_resource: ssh_key }

  redis_master_config:
    type: OS::Heat::ChefSolo
    depends_on: redis_master
    properties:
      username: root
      private_key: { get_attr: [ssh_key, private_key] }
      host: { get_attr: [redis_master, accessIPv4] }
      kitchen: https://github.com/rackspace-orchestration-templates/redis-sentinel.git
      node:
        run_list: [ "recipe[apt]",
                    "recipe[build-essential]",
                    "recipe[rax-redis::config_slave_sentinel]" ]
        redisio:
          default_settings:
            requirepass: { get_attr: [redis_password, value] }
          servers:
            - name: master
              port: { get_param: redis_port }
          sentinels:
            - sentinel_port: { get_param: sentinel_port }
              port:          { get_param: sentinel_port }
              name: 'cluster'
              master_ip:     { get_attr: [redis_master, accessIPv4] }
              master_port:   { get_param: redis_port }
              auth-pass:     { get_attr: [redis_password, value] }
              logfile: /var/log/sentinel.log
          version: { get_param: redis_version }

  redis_slave_nodes:
    type: "OS::Heat::ResourceGroup"
    depends_on: redis_master
    properties:
{'fraction_non_alphanumeric': 0.06750788643533123, 'fraction_numerical': 0.014637223974763407, 'mean_word_length': 2.403177329325891, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4244654', 'n_tokens_mistral': 2499, 'n_tokens_neox': 2330, 'n_words': 699}