<commit_before>---
- name: fail if not Ubuntu 14.04
  fail:
    msg: "{{ ansible_distribution_version }} is not an acceptable version of Ubuntu for this role"
  when: "ansible_distribution_version not in ['14.04', '14.10']"

- name: install the latest docker 
  shell: curl -sSL https://get.docker.com/ | sed 's/lxc-docker/lxc-docker-{{ docker_version }}/' | sh

- name: enable port forwarding
  lineinfile: 
    dest: /etc/default/ufw
    regexp: ^DEFAULT_FORWARD_POLICY=
    line: DEFAULT_FORWARD_POLICY="ACCEPT"
  notify: reload ufw

- name: enable memory limitation in cgroupd
  lineinfile: 
    dest: /etc/default/grub
    regexp: ^GRUB_CMDLINE_LINUX=
    line: GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
  register: grub_config

- name: reload grub config
  command: update-grub
  when: grub_config | changed
  notify: reboot vm

- name: waiting 2 minutes for server to come back
  local_action: wait_for timeout=120
  sudo: false
  when: grub_config | changed

- name: test docker installation
  shell: docker run hello-world
  
#- name: remove local docker group 
#  shell: groupdel docker
#  when: ldap_installed=="yes"<commit_msg>keeping the old version of docker for a while<commit_after>---
- name: fail if not Ubuntu 14.04
  fail:
    msg: "{{ ansible_distribution_version }} is not an acceptable version of Ubuntu for this role"
  when: "ansible_distribution_version not in ['14.04', '14.10']"

- name: install the latest docker 
  shell: curl -sSL https://get.docker.com/ | sh

- name: enable port forwarding
  lineinfile: 
    dest: /etc/default/ufw
    regexp: ^DEFAULT_FORWARD_POLICY=
    line: DEFAULT_FORWARD_POLICY="ACCEPT"
  notify: reload ufw

- name: enable memory limitation in cgroupd
  lineinfile: 
    dest: /etc/default/grub
    regexp: ^GRUB_CMDLINE_LINUX=
    line: GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
  register: grub_config

- name: reload grub config
  command: update-grub
  when: grub_config | changed
  notify: reboot vm

- name: waiting 2 minutes for server to come back
  local_action: wait_for timeout=120
  sudo: false
  when: grub_config | changed

- name: test docker installation
  shell: docker run hello-world

- name: local docker registry - add into hosts
  lineinfile: 
    dest: /etc/hosts
    line: '192.168.1.34 EMIFdockerReg'
    backup: yes
  with_items: 
    - '{{ groups.docker_openlava_nodes }}'
  tags: docker_registry

- name: local docker registry - add into docker config
  lineinfile: 
    dest: /etc/default/docker
    line: 'DOCKER_OPTS="--insecure-registry EMIFdockerReg:5000"'
    backup: yes
  with_items: 
    - '{{ groups.docker_openlava_nodes }}'
  tags: docker_registry

- name: local docker registry - restart docker
  shell: restart docker
  tags: docker_registry
#- name: remove local docker group 
#  shell: groupdel docker
#  when: ldap_installed=="yes"
{'fraction_non_alphanumeric': 0.09538784067085954, 'fraction_numerical': 0.01642208245981831, 'mean_word_length': 3.7166392092257, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '5973334', 'n_tokens_mistral': 1043, 'n_tokens_neox': 933, 'n_words': 286}