Parcourir la source

Merge pull request #22 from webscale-formulas/listchanges_support

add listchanges config and fixed typo in unattended.sls
master
Forrest il y a 8 ans
Parent
révision
abcea99c10
4 fichiers modifiés avec 61 ajouts et 1 suppressions
  1. +17
    -0
      apt/listchanges.sls
  2. +31
    -0
      apt/templates/listchanges_config.jinja
  3. +1
    -1
      apt/unattended.sls
  4. +12
    -0
      pillar.example

+ 17
- 0
apt/listchanges.sls Voir le fichier

@@ -0,0 +1,17 @@
# This is the main state file for configuring apt-listchanges
{% from "apt/map.jinja" import apt as apt_map with context %}
{% set apt = pillar.get('apt:listchanges', {}) -%}
{% set listchanges_config_template = apt.get('listchanges_config_template', 'salt://apt/templates/listchanges_config.jinja') -%}


apt_listchanges_pkgs:
pkg.installed:
- name: apt-listchanges

/etc/apt/listchanges.conf:
file.managed:
- template: jinja
- user: root
- group: root
- mode: 644
- source: {{ listchanges_config_template }}

+ 31
- 0
apt/templates/listchanges_config.jinja Voir le fichier

@@ -0,0 +1,31 @@
{% set apt = pillar.get('apt', {}) -%}
{% set unattended = apt.get('listchanges', {}) -%}
{%- for profile_name, profile_details in listchanges.get('profiles', {}).items() %}
{%- set frontend = profile_details.get('frontend', None) %}
{%- set email_address = profile_details.get('email_address', None) %}
{%- set confirm = profile_details.get('confirm', None) %}
{%- set save_seen = profile_details.get('save_seen', None) %}
{%- set which = profile_details.get('which', None) %}
{%- set browser = profile_details.get('browser', None %}

[{{ profile_name }}]
{%- if frontend != None %}
frontend={{ frontend }}
{%- endif %}
{%- if email_address != None %}
email_address={{ email_address }}
{%- endif %}
{%- if confirm != None %}
confirm={{ confirm }}
{%- endif %}
{%- if save_seen != None %}
save_seen={{ save_seen }}
{%- endif %}
{%- if which != None %}
which={{ which }}
{%- endif %}
{%- if browser != None %}
browser={{ browser }}
{%- endif %}

{%- endfor %}

+ 1
- 1
apt/unattended.sls Voir le fichier

@@ -4,7 +4,7 @@
{% set unattended_config_template = apt.get('unattended_config_template', 'salt://apt/templates/unattended_config.jinja') -%}
{% set periodic_config_template = apt.get('periodic_config_template', 'salt://apt/templates/periodic_config.jinja') -%}

apt_unattended_pakgs::
apt_unattended_pkgs:
pkg.installed:
- pkgs:
{% for pkg in apt_map.pkgs %}

+ 12
- 0
pillar.example Voir le fichier

@@ -27,6 +27,18 @@ apt:
auto_clean_interval: 7
verbose: 2

listchanges:
profiles:
cmdline:
frontend: pager
apt:
frontend: pager
email_address: root
confirm: 1
custom:
frontend: browser
browser: mozilla

repositories:
security-stable:
distro: stable/updates

Chargement…
Annuler
Enregistrer