<commit_before># see https://help.ubuntu.com/lts/serverguide/automatic-updates.html
package :security_upgrades do
  description 'Automatic security upgrades'

  requires :unattended_upgrades

  %w{10periodic 50unattended-upgrades}.each do |config_file|
    config_file_path = "/etc/apt/apt.conf.d/#{config_file}"
    config_template = File.join(File.dirname(__FILE__), 'configs', config_file)

    file config_file_path, contents: File.read(config_template), sudo: true, owner: 'root:root', mode: '644'
  end

  verify do
    has_file '/etc/apt/apt.conf.d/10periodic'
    has_file '/etc/apt/apt.conf.d/50unattended-upgrades'
  end
end

package :unattended_upgrades do
  apt 'unattended-upgrades' do
    pre :install, ['aptitude update']
  end

  verify do
    has_apt 'unattended-upgrades'
  end
end<commit_msg>Always copy config files for automatic security upgrades<commit_after># see https://help.ubuntu.com/lts/serverguide/automatic-updates.html
package :security_upgrades do
  description 'Automatic security upgrades'

  requires :unattended_upgrades

  %w{10periodic 50unattended-upgrades}.each do |config_file|
    config_file_path = "/etc/apt/apt.conf.d/#{config_file}"
    config_template = File.join(File.dirname(__FILE__), 'configs', config_file)

    file config_file_path, contents: File.read(config_template), sudo: true, owner: 'root:root', mode: '644'
  end
end

package :unattended_upgrades do
  apt 'unattended-upgrades' do
    pre :install, ['aptitude update']
  end

  verify do
    has_apt 'unattended-upgrades'
  end
end
{'fraction_non_alphanumeric': 0.11082307193778354, 'fraction_numerical': 0.011665586519766688, 'mean_word_length': 4.697416974169742, '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': '1183065', 'n_tokens_mistral': 550, 'n_tokens_neox': 511, 'n_words': 115}