<commit_before>---
- name: apt update
  become: 'yes'
  apt:
    update_cache: 'yes'
    cache_valid_time: 1800
  notify:
    - apt-get clean
    - apt-get autoremove
  when: ansible_os_family == "Debian"
  tags:
    - apt

- name: apt upgrade
  become: 'yes'
  apt:
    upgrade: safe
  when: ansible_os_family == "Debian" and system_upgrade|bool
  tags:
    - apt

- name: update dnf cache
  become: 'yes'
  dnf:
    update_cache: 'yes'
  when: ansible_os_family == "RedHat"
  notify:
    - dnf autoremove
  tags:
    - dnf
    - yum

- name: dnf upgrade
  become: 'yes'
  command: dnf --cacheonly --assumeyes upgrade-minimal
  register: dnf_upgrade_response
  changed_when: not dnf_upgrade_response.stdout.find('Nothing to do.') != -1
  when: ansible_os_family == "RedHat" and system_upgrade|bool
  tags:
    - dnf
    - yum

- name: python-rpm installation
  become: 'yes'
  dnf:
    name: "python2-rpm"
    state: present
  when: ansible_distribution == "RedHat"
  tags:
    - dnf
    - yum
    - packages
    - firewalld

- name: link dnf.conf
  become: 'yes'
  file:
    src: /etc/dnf/dnf.conf
    dest: /etc/yum.conf
    owner: root
    group: root
    state: link
  when: ansible_distribution == "Fedora"
  tags:
    - dnf
    - yum

- name: import RedHat RPM key
  become: 'yes'
  rpm_key:
    state: present
    key: https://sks-keyservers.net/pks/lookup?op=get&search=0x{{ item }}
  with_items:
    - "{{ redhat_rpm_key }}"
  when: ansible_distribution == "RedHat"
  tags:
    - dnf
    - yum

- name: set yum.conf gpgcheck
  become: 'yes'
  lineinfile:
    regexp: "^gpgcheck="
    line: "gpgcheck=1"
    dest: /etc/yum.conf
    mode: 0644
    state: present
    create: 'no'
    backrefs: 'yes'
  when: ansible_os_family == "RedHat"
  tags:<commit_msg>ansible_os_family == "RedHat" should install RedHat keys, change to keyserver.ubuntu.com<commit_after>---
- name: apt update
  become: 'yes'
  apt:
    update_cache: 'yes'
    cache_valid_time: 1800
  notify:
    - apt-get clean
    - apt-get autoremove
  when: ansible_os_family == "Debian"
  tags:
    - apt

- name: apt upgrade
  become: 'yes'
  apt:
    upgrade: safe
  when: ansible_os_family == "Debian" and system_upgrade|bool
  tags:
    - apt

- name: update dnf cache
  become: 'yes'
  dnf:
    update_cache: 'yes'
  when: ansible_os_family == "RedHat"
  notify:
    - dnf autoremove
  tags:
    - dnf
    - yum

- name: dnf upgrade
  become: 'yes'
  command: dnf --cacheonly --assumeyes upgrade-minimal
  register: dnf_upgrade_response
  changed_when: not dnf_upgrade_response.stdout.find('Nothing to do.') != -1
  when: ansible_os_family == "RedHat" and system_upgrade|bool
  tags:
    - dnf
    - yum

- name: python-rpm installation
  become: 'yes'
  dnf:
    name: "python2-rpm"
    state: present
  when: ansible_distribution == "RedHat"
  tags:
    - dnf
    - yum
    - packages
    - firewalld

- name: link dnf.conf
  become: 'yes'
  file:
    src: /etc/dnf/dnf.conf
    dest: /etc/yum.conf
    owner: root
    group: root
    state: link
  when: ansible_distribution == "Fedora"
  tags:
    - dnf
    - yum

- name: import RedHat RPM key
  become: 'yes'
  rpm_key:
    state: present
    key: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x{{ item }}
  with_items:
    - "{{ redhat_rpm_key }}"
  when: ansible_os_family == "RedHat"
  tags:
    - dnf
    - rpm
    - yum

- name: set yum.conf gpgcheck
  become: 'yes'
  lineinfile:
    regexp: "^gpgcheck="
    line: "gpgcheck=1"
    dest: /etc/yum.conf
    mode: 0644
    state: present
    create: 'no'
    backrefs: 'yes'
  when: ansible_os_family == "RedHat"
  tags:
{'fraction_non_alphanumeric': 0.12174875484228002, 'fraction_numerical': 0.006640841173215274, 'mean_word_length': 2.5756676557863503, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '3264070', 'n_tokens_mistral': 1460, 'n_tokens_neox': 1422, 'n_words': 340}