Browse Source

add listchanges config and fixed typo in unattended.sls

tags/v0.7.0
Niels Abspoel 8 years ago
parent
commit
5570415469
4 changed files with 61 additions and 1 deletions
  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 View File

# 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 View File

{% 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 View File

{% set unattended_config_template = apt.get('unattended_config_template', 'salt://apt/templates/unattended_config.jinja') -%} {% 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') -%} {% set periodic_config_template = apt.get('periodic_config_template', 'salt://apt/templates/periodic_config.jinja') -%}


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

+ 12
- 0
pillar.example View File

auto_clean_interval: 7 auto_clean_interval: 7
verbose: 2 verbose: 2


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

repositories: repositories:
security-stable: security-stable:
distro: stable/updates distro: stable/updates

Loading…
Cancel
Save