<commit_before>---
- name: Create EC2 Instance(s) for HAProxy Servers
  hosts: localhost
  connection: local
  gather_facts: False
  vars:
    inifile:        "{{ inventory_dir }}/files/aws.ini"
    access_key:     "{{ lookup('ini', 'access_key section=credential file=' + inifile) }}"
    secret_key:     "{{ lookup('ini', 'secret_key section=credential file=' + inifile) }}"
    security_group: "{{ lookup('ini', 'public section=security_groups file=' + inifile) }}"
    ec2_name:   "ec2-{{ zone }}-haproxy"
    instances:  "{{ groups['haproxy-' + zone] }}"

  tasks:
  - name: launch ec2 instance(s) for haproxy
    vars:
      subnet_name: "{{ item | subnet_name(aws) }}"
      subnet_id:   "{{ lookup('ini', 'subnet-' + subnet_name + ' section=subnets file=' + inifile) }}"
    ec2:
      assign_public_ip: yes
      aws_access_key:   "{{ access_key }}"
      aws_secret_key:   "{{ secret_key }}"
      ebs_optimized:  yes
      group_id:         "{{ security_group }}"
      image:            "{{ aws.ami.centos }}"
      instance_tags:
        Name:             "{{ ec2_name }}"
        organization:     "{{ aws.organization }}"
        owner:            "{{ aws.owner }}"
      instance_type:    m5.large
      key_name:         platform
      private_ip:       "{{ item }}"
      region:           "{{ aws.region }}"
      volumes:
      - delete_on_termination: yes
        device_name: /dev/sda1
        volume_size: 8
        volume_type: gp2
      vpc_subnet_id:    "{{ subnet_id }}"
      wait: yes
    with_items: "{{ instances }}"
    register: ec2

  - include: roles/common/tasks/tagging-volume.yml
    vars:
      target:     "{{ item.instances.0 }}"
      volume:      /dev/sda1
      volume_name: "{{ ec2_name }}"<commit_msg>update ec2-haproxy.yml<commit_after>---
- name: Create EC2 Instance(s) for HAProxy Servers
  hosts: localhost
  connection: local
  gather_facts: False
  vars:
    inifile:    "{{ inventory_dir }}/files/aws.ini"
    access_key: "{{ lookup('ini', 'access_key section=credential file=' + inifile) }}"
    secret_key: "{{ lookup('ini', 'secret_key section=credential file=' + inifile) }}"
    ec2_name:   "ec2-{{ zone }}-haproxy"
    instances:  "{{ groups['haproxy-' + zone] }}"

  tasks:
  - name: launch ec2 instance(s) for haproxy
    vars:
      subnet_name: "{{ item | subnet_name(aws) }}"
      subnet_id:   "{{ lookup('ini', subnet_name + ' section=subnets file=' + inifile) }}"
    ec2:
      assign_public_ip: yes
      aws_access_key:   "{{ access_key }}"
      aws_secret_key:   "{{ secret_key }}"
      ebs_optimized:  yes
      group_id:
      - "{{ lookup('ini', 'sg-' + aws.role + '-public section=security_groups file=' + inifile) }}"
      image:            "{{ aws.ami.centos }}"
      instance_tags:
        Name:             "{{ ec2_name }}"
        organization:     "{{ aws.organization }}"
        owner:            "{{ aws.owner }}"
      instance_type:    m5.large
      key_name:         platform
      private_ip:       "{{ item }}"
      region:           "{{ aws.region }}"
      volumes:
      - delete_on_termination: yes
        device_name: /dev/sda1
        volume_size: 8
        volume_type: gp2
      vpc_subnet_id:    "{{ subnet_id }}"
      wait: yes
    with_items: "{{ instances }}"
    register: ec2

  - include: roles/common/tasks/tagging-volume.yml
    vars:
      target:     "{{ item.instances.0 }}"
      volume:      /dev/sda1
      volume_name: "{{ ec2_name }}"
{'fraction_non_alphanumeric': 0.15075231481481483, 'fraction_numerical': 0.008391203703703705, 'mean_word_length': 2.267485822306238, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5539602', 'n_tokens_mistral': 1207, 'n_tokens_neox': 1194, 'n_words': 230}