<commit_before>---

- name: Disable firewalld
  service:
    name: firewalld
    state: stopped
    enabled: no

- name: Set timezone to UTC
  command: timedatectl set-timezone UTC
  when: ansible_date_time.tz != 'UTC'

- name: Put /etc/hosts in place
  template:
    src: etc.hosts.j2
    dest: /etc/hosts
    owner: root
    group: root
    mode: 0644

- name: Enable selinux
  selinux:
    policy: targeted
    state: enforcing

- name: Disable fastestmirror plugin
  ini_file:
    dest: /etc/yum/pluginconf.d/fastestmirror.conf
    section: main
    option: enabled
    value: 0
    mode: 0644
    backup: yes

- name: Install epel repository package
  package:
    name: epel-release
    state: latest

- name: Enable epel repo
  ini_file:
    dest: /etc/yum.repos.d/epel.repo
    section: epel
    option: enabled
    value: 1
    mode: 0644
    backup: no

- name: Pre-requisite packages
  package:
    name: "{{ item }}"
    state: latest
  with_items:
    - bash-completion
    - bind-utils
    - bridge-utils
    - docker
    - git
    - iptables-services
    - java-1.8.0-openjdk-headless
    - libnfsidmap
    - net-tools
    - nfs-utils
    - pyOpenSSL
    - screen
    - strace
    - tcpdump
    - wget

- name: Pre-requisite pips
  pip:
    name: "{{ item }}"
    state: latest
  with_items:
    - passlib

- name: Disable epel repo
  ini_file:
    dest: /etc/yum.repos.d/epel.repo
    section: epel
    option: enabled
    value: 0
    mode: 0644
    backup: no

- name: Update docker options
  lineinfile:
    dest: /etc/sysconfig/docker
    backup: yes
    create: no
    state: present
    regexp: '^OPTIONS='
    line: OPTIONS=' --selinux-enabled --log-driver=json-file --log-opt max-size=50m --insecure-registry 172.30.0.0/16'
  register: sysconfig_docker

- name: Restart docker
  service:
    name: docker
    state: restarted
    enabled: yes
  when: sysconfig_docker.changed

- name: Generate ssh-key for vagrant
  user:
    name: vagrant
    state: present
    shell: /bin/bash
    home: /home/vagrant
    generate_ssh_key: yes
    ssh_key_bits: 2048
    ssh_key_file: ./.ssh/id_rsa

- name: Add vagrant ssh key to authorized_keys
  authorized_key:
    user: vagrant
    state: present
    key: "{{ lookup('file', '/home/vagrant/.ssh/id_rsa.pub') }}"
    path: /home/vagrant/.ssh/authorized_keys<commit_msg>Remove docker config patching as now moved to install<commit_after>---

- name: Disable firewalld
  service:
    name: firewalld
    state: stopped
    enabled: no

- name: Set timezone to UTC
  command: timedatectl set-timezone UTC
  when: ansible_date_time.tz != 'UTC'

- name: Put /etc/hosts in place
  template:
    src: etc.hosts.j2
    dest: /etc/hosts
    owner: root
    group: root
    mode: 0644

- name: Enable selinux
  selinux:
    policy: targeted
    state: enforcing

- name: Disable fastestmirror plugin
  ini_file:
    dest: /etc/yum/pluginconf.d/fastestmirror.conf
    section: main
    option: enabled
    value: 0
    mode: 0644
    backup: yes

- name: Install epel repository package
  package:
    name: epel-release
    state: latest

- name: Enable epel repo
  ini_file:
    dest: /etc/yum.repos.d/epel.repo
    section: epel
    option: enabled
    value: 1
    mode: 0644
    backup: no

- name: Pre-requisite packages
  package:
    name: "{{ item }}"
    state: latest
  with_items:
    - bash-completion
    - bind-utils
    - bridge-utils
    - docker
    - git
    - iptables-services
    - java-1.8.0-openjdk-headless
    - libnfsidmap
    - net-tools
    - nfs-utils
    - pyOpenSSL
    - screen
    - strace
    - tcpdump
    - wget

- name: Pre-requisite pips
  pip:
    name: "{{ item }}"
    state: latest
  with_items:
    - passlib

- name: Disable epel repo
  ini_file:
    dest: /etc/yum.repos.d/epel.repo
    section: epel
    option: enabled
    value: 0
    mode: 0644
    backup: no

- name: Generate ssh-key for vagrant
  user:
    name: vagrant
    state: present
    shell: /bin/bash
    home: /home/vagrant
    generate_ssh_key: yes
    ssh_key_bits: 2048
    ssh_key_file: ./.ssh/id_rsa

- name: Add vagrant ssh key to authorized_keys
  authorized_key:
    user: vagrant
    state: present
    key: "{{ lookup('file', '/home/vagrant/.ssh/id_rsa.pub') }}"
    path: /home/vagrant/.ssh/authorized_keys
{'fraction_non_alphanumeric': 0.10224089635854341, 'fraction_numerical': 0.015172735760971055, 'mean_word_length': 2.3012326656394455, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2545233', 'n_tokens_mistral': 1634, 'n_tokens_neox': 1528, 'n_words': 402}