~doanac/utah/rsyslog-v4

« back to all changes in this revision

Viewing changes to templates/install-commands.jinja2

  • Committer: Javier Collado
  • Date: 2013-02-27 16:10:59 UTC
  • mfrom: (822.1.14 bug1126115)
  • Revision ID: javier.collado@canonical.com-20130227161059-y4brif9rhbrt68v2
Added success command failure detection (LP: #1126115)

Source branch: lp:~javier.collado/utah/wrap-latecommand

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{% macro install_commands(packages, log_file) -%}
 
2
{% include "log-function.jinja2" %}
 
3
 
 
4
{% from "check-locks-command.jinja2" import check_locks_command -%}
 
5
# Check lock files before package installation
 
6
check_locks() {
 
7
    {{ check_locks_command() | indent }}
 
8
}
 
9
 
 
10
install_package() {
 
11
    package=$1
 
12
    check_locks
 
13
    log "Installing ${package}..."
 
14
    apt-get install -y ${package} --force-yes  >>{{log_file}} 2>&1
 
15
}
 
16
 
 
17
install_packages() {
 
18
    log "Installing packages..."
 
19
    for package in $@
 
20
    do
 
21
        install_package ${package}
 
22
    done
 
23
}
 
24
 
 
25
install_packages {{packages | join(' ')}}
 
26
{%- endmacro %}