<commit_before>---

# access secrets
- hosts: localhost
  vars:
    credstash_table: "credential-store"
    credstash_secrets: 
      - table: "{{ credstash_table }}"
        secret: "{{ environ }}.simple_db.password"
        fact: "simple_aws_dbpass"
        context: "env={{ environ }}"
  roles:
  - role: credstash
    secrets: "{{ credstash_secrets }}"

# rds stack
- hosts: localhost
  gather_facts: false
  tasks:
    - include_vars: vars/main.yml
    - name: Launch MySQL RDS
      cloudformation:
        stack_name: "simpleinvoice-{{ target_counter }}-mysql-rds-stack"
        state: present
        region: us-east-1
        template: templates/pg-rds-us-east-1.json
        template_parameters:
          Environment: "{{ environ }}"
          Application: "simpleinvoice"
          applicationShortName: "si"
          counter: "{{ target_counter }}"
          masterPass: "{{ <PASSWORD> }}"
          instanceClass: "{{ instance_class }}"
          allocatedStorage: "{{ alloc_storage }}"
          storageEncrypted: "{{ true|bool }}"
        tags:
          "stellar:env": "{{ environ }}"
          "stellar:unit": techops
          "stellar:product": "simpleinvoice"
          "stellar:owner": "<EMAIL>"
          "stellar:hours_of_operation": "0000-2359"

# long lived load balancer stack
- hosts: localhost
  gather_facts: false
  vars:
    frontelb_health_check_target: TCP:8080
    frontelb_zone_name: "stellarkeys.io"
    frontelb_dns_name: "invoice.stellarkeys.io"
    frontelb_stack_name: "simpleinvoice-elb{% if stack_num is defined %}-{{stack_num|default(1)}}{% endif %}"
    frontelb_scheme: internet-facing
    frontelb_listeners:
        - instancePort: 8080
          instanceProtocol: "http"
          port: 443
          protocol: "https"
          allowed:<commit_msg>changing elb schema to internal<commit_after>---

# access secrets
- hosts: localhost
  vars:
    credstash_table: "credential-store"
    credstash_secrets: 
      - table: "{{ credstash_table }}"
        secret: "{{ environ }}.simple_db.password"
        fact: "simple_aws_dbpass"
        context: "env={{ environ }}"
  roles:
  - role: credstash
    secrets: "{{ credstash_secrets }}"

# rds stack
- hosts: localhost
  gather_facts: false
  tasks:
    - include_vars: vars/main.yml
    - name: Launch MySQL RDS
      cloudformation:
        stack_name: "simpleinvoice-{{ target_counter }}-mysql-rds-stack"
        state: present
        region: us-east-1
        template: templates/pg-rds-us-east-1.json
        template_parameters:
          Environment: "{{ environ }}"
          Application: "simpleinvoice"
          applicationShortName: "si"
          counter: "{{ target_counter }}"
          masterPass: "{{ simple_aws_dbpass }}"
          instanceClass: "{{ instance_class }}"
          allocatedStorage: "{{ alloc_storage }}"
          storageEncrypted: "{{ true|bool }}"
        tags:
          "stellar:env": "{{ environ }}"
          "stellar:unit": techops
          "stellar:product": "simpleinvoice"
          "stellar:owner": "<EMAIL>"
          "stellar:hours_of_operation": "0000-2359"

# long lived load balancer stack
- hosts: localhost
  gather_facts: false
  vars:
    frontelb_health_check_target: TCP:8080
    frontelb_zone_name: "stellarkeys.io"
    frontelb_dns_name: "invoice.stellarkeys.io"
    frontelb_stack_name: "simpleinvoice-elb{% if stack_num is defined %}-{{stack_num|default(1)}}{% endif %}"
    frontelb_scheme: internal
    frontelb_listeners:
        - instancePort: 8080
          instanceProtocol: "http"
          port: 443
          protocol: "https"
          allowed:
{'fraction_non_alphanumeric': 0.1230641592920354, 'fraction_numerical': 0.012168141592920354, 'mean_word_length': 2.5882936507936507, 'pattern_counts': {'":': 10, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, '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': '882003', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1131, 'n_words': 227}