<commit_before>---

- name: Ensure hostname is resolvable
  become: yes
  lineinfile:
    dest: /etc/hosts
    line: "127.0.0.1 localhost {{ ansible_hostname }}"
    regexp: ^127\.0\.0\.1
  when: ansible_virtualization_type != 'docker'

- name: Ensures go-agent configuration
  become: yes
  template:
    dest: /etc/default/go-agent
    group: "{{ sansible_gocd_agent_user }}"
    owner: "{{ sansible_gocd_agent_user }}"
    src: defaults.j2
  notify:
    - restart go-agent

- name: Grab IP of GOCD Server
  command: "aws ec2 describe-instances --region eu-west-1 --filters {{ sansible_gocd_agent_aws_gocd_server_lookup_filter }} --output text --query 'Reservations[*].Instances[*].PrivateIpAddress'"
  register: gocd_server_ip
  when: sansible_gocd_agent_aws_gocd_server_lookup_filter is not none

- name: Set IP of GOCD server
  set_fact:
    gocd_agent:
      server: "{{ gocd_server_ip.stdout }}"
  when: sansible_gocd_agent_aws_gocd_server_lookup_filter is not none

- name: Copy secrets from S3
  become: yes
  become_user: "{{ sansible_gocd_agent_user }}"
  command: "aws s3 cp --region {{ sansible_gocd_agent_aws_region }} {{ item.s3_path }} {{ item.local_path }}"
  args:
    creates: "{{ item.local_path }}"<commit_msg>[GITHUB-31] Flatten Missed Variable<commit_after>---

- name: Ensure hostname is resolvable
  become: yes
  lineinfile:
    dest: /etc/hosts
    line: "127.0.0.1 localhost {{ ansible_hostname }}"
    regexp: ^127\.0\.0\.1
  when: ansible_virtualization_type != 'docker'

- name: Ensures go-agent configuration
  become: yes
  template:
    dest: /etc/default/go-agent
    group: "{{ sansible_gocd_agent_user }}"
    owner: "{{ sansible_gocd_agent_user }}"
    src: defaults.j2
  notify:
    - restart go-agent

- name: Grab IP of GOCD Server
  command: "aws ec2 describe-instances --region eu-west-1 --filters {{ sansible_gocd_agent_aws_gocd_server_lookup_filter }} --output text --query 'Reservations[*].Instances[*].PrivateIpAddress'"
  register: gocd_server_ip
  when: sansible_gocd_agent_aws_gocd_server_lookup_filter is not none

- name: Set IP of GOCD server
  set_fact:
    sansible_gocd_agent_gocd_server: "{{ gocd_server_ip.stdout }}"
  when: sansible_gocd_agent_aws_gocd_server_lookup_filter is not none

- name: Copy secrets from S3
  become: yes
  become_user: "{{ sansible_gocd_agent_user }}"
  command: "aws s3 cp --region {{ sansible_gocd_agent_aws_region }} {{ item.s3_path }} {{ item.local_path }}"
  args:
    creates: "{{ item.local_path }}"
{'fraction_non_alphanumeric': 0.11963067041348856, 'fraction_numerical': 0.015254917703733441, 'mean_word_length': 3.984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1636435', 'n_tokens_mistral': 941, 'n_tokens_neox': 928, 'n_words': 198}