<commit_before>---
## usual suspects:
#    http://bastille-linux.sourceforge.net/
#    https://cisofy.com/lynis/
#    https://fedorahosted.org/aqueduct/wiki
## https://github.com/fcaviggia/hardening-script-el6
## https://github.com/major/securekickstarts

- name: Include version-specific variables for Ubuntu.
  include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
  when: ansible_distribution == 'Ubuntu'
- name: Include version-specific variables for Debian.
  include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
  when: ansible_distribution == 'Debian'
- name: Include version-specific variables for RedHat
  include_vars: "RedHat-{{ ansible_distribution_version.split('.')[0] }}.yml"
  when: ansible_os_family == "RedHat"
- name: Include version-specific variables for Alpine
  include_vars: "Alpine.yml"
  when: ansible_os_family == "Alpine"

- include: travis.yml
  when: ansible_os_family != "Windows"

- name: Ensure archives folder exists
  file:
    dest: "{{ install_archives }}"
    state: directory
    mode: '0700'

- include: debian-apt-source.yml
  when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'

## FIXME! travis/docker/xenial+trusty: 'Error: No information about packages!
##    (Maybe no deb entries?)\r\ndpkg: error processing package apt-show-versions (--configure)'
## https://groups.google.com/forum/#!topic/beagleboard/jXb9KhoMOsk  = Not that, settings non-existent
- name: Install some hardening packages
  package:
    name: "{{ harden_pkg }}"
    state: present
    update_cache: yes
    cache_valid_time: 3600
  register: pkg_result
  until: pkg_result is success
- name: Install some hardening packages - not in container
  package:
    name: "{{ harden_pkg_not_container | default([]) }}"
    state: present
    update_cache: yes
    cache_valid_time: 3600
  register: pkg_result
  until: pkg_result is success
  when: not (ansible_virtualization_type is defined and<commit_msg>package/apt: add cache_valid_time (2)<commit_after>---
## usual suspects:
#    http://bastille-linux.sourceforge.net/
#    https://cisofy.com/lynis/
#    https://fedorahosted.org/aqueduct/wiki
## https://github.com/fcaviggia/hardening-script-el6
## https://github.com/major/securekickstarts

- name: Include version-specific variables for Ubuntu.
  include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
  when: ansible_distribution == 'Ubuntu'
- name: Include version-specific variables for Debian.
  include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
  when: ansible_distribution == 'Debian'
- name: Include version-specific variables for RedHat
  include_vars: "RedHat-{{ ansible_distribution_version.split('.')[0] }}.yml"
  when: ansible_os_family == "RedHat"
- name: Include version-specific variables for Alpine
  include_vars: "Alpine.yml"
  when: ansible_os_family == "Alpine"

- include: travis.yml
  when: ansible_os_family != "Windows"

- name: Ensure archives folder exists
  file:
    dest: "{{ install_archives }}"
    state: directory
    mode: '0700'

- include: debian-apt-source.yml
  when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'

- name: Debian | update apt cache
  apt:
    update_cache: yes
    cache_valid_time: 3600
  when: ansible_os_family == "Debian"

## FIXME! travis/docker/xenial+trusty: 'Error: No information about packages!
##    (Maybe no deb entries?)\r\ndpkg: error processing package apt-show-versions (--configure)'
## https://groups.google.com/forum/#!topic/beagleboard/jXb9KhoMOsk  = Not that, settings non-existent
- name: Install some hardening packages
  package:
    name: "{{ harden_pkg }}"
    state: present
  register: pkg_result
  until: pkg_result is success
- name: Install some hardening packages - not in container
  package:
    name: "{{ harden_pkg_not_container | default([]) }}"
    state: present
  register: pkg_result
  until: pkg_result is success
  when: not (ansible_virtualization_type is defined and
{'fraction_non_alphanumeric': 0.12342941611234294, 'fraction_numerical': 0.0066518847006651885, 'mean_word_length': 4.464333781965006, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, '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': '2431979', 'n_tokens_mistral': 1398, 'n_tokens_neox': 1289, 'n_words': 315}