<commit_before># Playbook to create a single instance in EC-2

### Overview
Playbook will:
  * Create a public VPC if it does not exist
  * Create a security group if it does not exist
  * Create an instance with a specific Name if does not exist
  * Associate an elastic ip to the instance
  * Configure a hostname with the elastic ip through Route53
  * Wait for SSH to be up on the instance
  * Install Apache onto the instance as an example of working with a tagged instance from a dynamic inventory

### Pre-Reqs
  * Ansible needs to be installed so it's source code is available to Python.
    * Check to see if Ansible modules are available to Python
            $ python -c "import ansible;print(ansible.__version__)"
            2.2.2.0
    * MacOS requires Ansible to be installed from `pip` and not `brew`
          $ python -c "import ansible;print(ansible.__version__)"
          Traceback (most recent call last):
          File "<string>", line 1, in <module>
          ImportError: No module named ansible

          brew uninstall ansible
          pip install ansible

          $ python -c "import ansible;print(ansible.__version__)"
          2.2.2.0
  * Install python dependencies
     * `pip install boto boto3 six`
  * Configure a SSH Key in your AWS EC-2 account for the given region
  * Create a hosted zone in Route53
  * Set these environment variables:
    * AWS_ACCESS_KEY_ID
    * AWS_SECRET_ACCESS_KEY
    * AWS_SSH_PRIV_KEY_PATH  - Path to your private ssh key to use for the ec2 instances

### Execute
  * Edit the variables file `common_vars`
    * Update:
            export AWS_SSH_KEY_NAME="splice"
            export TARGET_DNS_ZONE="ec2.dog8code.com"
        * TARGET_DNS_ZONE needs to match a hosted zone entry in your Route53 account, we will create a subdomain under it for the ec2 instance
  * `./run_create_infrastructure.sh`
    * Creates our infrastructure in ec2 if it doesn't exist
  * `./run_install_and_configure.sh`
    * Uses a dynamic EC-2 Inventory and executes a task as a test on what we previously created based on a tag

### Tested with
  * ansible 2.2.2.0
    * Problems were seen using ansible 2.0<commit_msg>Markdown tweak<commit_after># Playbook to create a single instance in EC-2

### Overview
Playbook will:
  * Create a public VPC if it does not exist
  * Create a security group if it does not exist
  * Create an instance with a specific Name if does not exist
  * Associate an elastic ip to the instance
  * Configure a hostname with the elastic ip through Route53
  * Wait for SSH to be up on the instance
  * Install Apache onto the instance as an example of working with a tagged instance from a dynamic inventory

### Pre-Reqs
  * Ansible needs to be installed so it's source code is available to Python.
    * Check to see if Ansible modules are available to Python
            $ python -c "import ansible;print(ansible.__version__)"
            2.2.2.0
    * MacOS requires Ansible to be installed from `pip` and not `brew`
          $ python -c "import ansible;print(ansible.__version__)"
          Traceback (most recent call last):
          File "<string>", line 1, in <module>
          ImportError: No module named ansible

          brew uninstall ansible
          pip install ansible

          $ python -c "import ansible;print(ansible.__version__)"
          2.2.2.0
  * Install python dependencies
     * `pip install boto boto3 six`
  * Configure a SSH Key in your AWS EC-2 account for the given region
  * Create a hosted zone in Route53
  * Set these environment variables:
    * AWS_ACCESS_KEY_ID
    * AWS_SECRET_ACCESS_KEY
    * AWS_SSH_PRIV_KEY_PATH  - Path to your private ssh key to use for the ec2 instances

### Execute
  * Edit the variables file `common_vars`
    * Update:
              export AWS_SSH_KEY_NAME="splice"
              export TARGET_DNS_ZONE="ec2.dog8code.com"
        * TARGET_DNS_ZONE needs to match a hosted zone entry in your Route53 account, we will create a subdomain under it for the ec2 instance
  * `./run_create_infrastructure.sh`
    * Creates our infrastructure in ec2 if it doesn't exist
  * `./run_install_and_configure.sh`
    * Uses a dynamic EC-2 Inventory and executes a task as a test on what we previously created based on a tag

### Tested with
  * ansible 2.2.2.0
    * Problems were seen using ansible 2.0
{'fraction_non_alphanumeric': 0.05845799769850403, 'fraction_numerical': 0.01380897583429229, 'mean_word_length': 2.880357142857143, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '3716782', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1220, 'n_words': 554}