Run `apt-get update` before installing other packages with Puppet

后端 未结 8 1200
青春惊慌失措
青春惊慌失措 2020-12-07 11:21

I\'m trying to create puppet module which automates installation of zend server CE, this is not important here, but steps are as following

  1. update /etc/apt/sour
8条回答
  •  既然无缘
    2020-12-07 12:05

    Since Puppet 2.6.0 a new feature "relationship syntax" was introduced.

    An example in Puppet 2.6.0 and above would look like this:

    exec { "apt-update":
        command => "/usr/bin/apt-get update"
    }
    
    Exec["apt-update"] -> Package <| |>
    

    Every time a package command is executed, the dependency (in our case 'apt-update') will be triggered fist. You can even define longer chains.

提交回复
热议问题