dev/modules/sysconfig/manifests/sys_upgrade.pp
author Nicolas DURAND <nicolas.durand@iri.centrepompidou.fr>
Mon, 29 Dec 2014 18:01:09 +0100
changeset 14 fc63b1a3d2ef
parent 0 54f4e0f9d636
permissions -rw-r--r--
Added support for making multiple changes in a single commit, using the flask dict "session" (keys used are "modified_categories" and "deleted_categories") + Added a view for editing categories that allows the user to see what he has added, deleted or edited + Made it so an unauthenticated user should not generate any Github api request (you have to be logged to see the categories now).

class sysconfig::sys_upgrade {

  exec {
    'apt_source_update':
      command   => "echo 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main dependencies' > /etc/apt/sources.list.d/pgdg.list;,
                    wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -;",
      timeout   => 0,
      provider  => 'shell',
      returns   => [0, 100];
    'apt_get_update_sysconfig':
      command     => '/usr/bin/apt-get update',
      timeout     => 2400,
      returns     => [ 0, 100 ],
#     refreshonly => true;
      require     => Exec['apt_source_update'];
    'sys-upgrade':
      command   => '/usr/bin/apt-get upgrade -y',
      timeout => 0,
      require   => Exec['apt_get_update_sysconfig'];
    'sys-dist-upgrade':
      command   => '/usr/bin/apt-get dist-upgrade -y',
      timeout => 0,
      require   => Exec['apt_get_update_sysconfig'];
  }

  Exec['apt_get_update_sysconfig'] -> Exec['sys-upgrade'] -> Exec['sys-dist-upgrade']
  
}