<commit_before>---
- name: update apt
  apt: >
    update_cache=yes
    cache_valid_time=3600

- name: install deps
  apt: >
    pkg={{item}}
    state=installed
  with_items:
    - unzip

- name: create consul-template directory structure
  file: >
    state=directory
    path={{ item }}
  with_items:
    - "{{ consul_template_home }}"
    - "{{ consul_template_home }}/bin"
    - "{{ consul_template_home }}/config"
    - "{{ consul_template_home }}/templates"

- name: download consul-template binary
  get_url:
    url: "{{ consul_template_download_url }}"
    dest: "/tmp"

- name: unzip the downloaded package
  unarchive:
    src: "/tmp/{{ consul_template_archive_file }}"
    dest: "/tmp"
    owner: "root"
    group: "root"
    creates: "/tmp/{{ consul_template_release }}/{{ consul_template_binary }}"

- name: copy consul-template binary into place
  copy:
    src: "/tmp/{{ consul_template_release }}/{{ consul_template_binary }}"
    dest: "{{ consul_template_home }}/bin/{{ consul_template_binary }}"
    owner: "root"
    group: "root"
    mode: "0755"

- name: copy consul-template systemd service configuration
  template: >
    src=consul-template.service.systemd.j2
    dest=/etc/systemd/system/consul-template.service
    mode=0755
  when: consul_template_use_systemd

- name: copy consul-template upstart service configuration
  template: >
    src=consul-template.service.upstart.j2
    dest=/etc/init/consul-template.conf
    mode=0755
  when: consul_template_use_upstart

- name: add consul-template to path through profile.d
  template: >
    src=consul-template.sh.j2
    dest=/etc/profile.d/consul-template.sh
    owner=root
    group=root
    mode=0755

- name: consul-template config file
  template: >
    src={{ consul_template_config_file_template }}
    dest={{ consul_template_home }}/config/{{ consul_template_config_file }}
    mode=0755

- name: consul-template log rotation
  template: > 
    src=consul-template.logrotate.j2
    dest=/etc/logrotate.d/consul-template
    mode=0644
<commit_msg>Not sure how this ever worked, without the copy: no the archive would have been copied from localhost instead of the remote server<commit_after>---
- name: update apt
  apt: >
    update_cache=yes
    cache_valid_time=3600

- name: install deps
  apt: >
    pkg={{item}}
    state=installed
  with_items:
    - unzip

- name: create consul-template directory structure
  file: >
    state=directory
    path={{ item }}
  with_items:
    - "{{ consul_template_home }}"
    - "{{ consul_template_home }}/bin"
    - "{{ consul_template_home }}/config"
    - "{{ consul_template_home }}/templates"

- name: download consul-template binary
  get_url:
    url: "{{ consul_template_download_url }}"
    dest: "/tmp"

- name: unzip the downloaded package
  unarchive:
    copy: no
    src: "/tmp/{{ consul_template_archive_file }}"
    dest: "/tmp"
    owner: "root"
    group: "root"
    creates: "/tmp/{{ consul_template_release }}/{{ consul_template_binary }}"

- name: copy consul-template binary into place
  copy:
    src: "/tmp/{{ consul_template_release }}/{{ consul_template_binary }}"
    dest: "{{ consul_template_home }}/bin/{{ consul_template_binary }}"
    owner: "root"
    group: "root"
    mode: "0755"

- name: copy consul-template systemd service configuration
  template: >
    src=consul-template.service.systemd.j2
    dest=/etc/systemd/system/consul-template.service
    mode=0755
  when: consul_template_use_systemd

- name: copy consul-template upstart service configuration
  template: >
    src=consul-template.service.upstart.j2
    dest=/etc/init/consul-template.conf
    mode=0755
  when: consul_template_use_upstart

- name: add consul-template to path through profile.d
  template: >
    src=consul-template.sh.j2
    dest=/etc/profile.d/consul-template.sh
    owner=root
    group=root
    mode=0755

- name: consul-template config file
  template: >
    src={{ consul_template_config_file_template }}
    dest={{ consul_template_home }}/config/{{ consul_template_config_file }}
    mode=0755

- name: consul-template log rotation
  template: > 
    src=consul-template.logrotate.j2
    dest=/etc/logrotate.d/consul-template
    mode=0644

{'fraction_non_alphanumeric': 0.12124821343496903, 'fraction_numerical': 0.015245354930919485, 'mean_word_length': 3.4153522607781284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4356510', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1419, 'n_words': 300}