eagleshi 发表于 2018-8-3 10:19:57

puppet的refresh与refreshonly参数作用

  - **refresh**
  How to refresh this command.By default, the exec is just
  called again when it receives an event from another resource,
  but this parameter allows you to define a different command
  for refreshing.
  - **refreshonly**
  The command should only be run as a
  refresh mechanism for when a dependent object is changed.It only
  makes sense to use this option when this command depends on some
  other object; it is useful for triggering an action::
  # Pull down the main aliases file
  file { "/etc/aliases":
  source => "puppet://server/module/aliases"
  }
  # Rebuild the database, but only when the file changes
  exec { newaliases:
  path => ["/usr/bin", "/usr/sbin"],
  subscribe => File["/etc/aliases"],
  refreshonly => true
  }
  Note that only ``subscribe`` and ``notify`` can trigger actions, not
  ``require``,
  so it only makes sense to use ``refreshonly`` with ``subscribe`` or
  ``notify``.Valid values are ``true``, ``false``.
  refresh可能不太好理解,但refreshonly在pi命令中解释的比较清楚
页: [1]
查看完整版本: puppet的refresh与refreshonly参数作用