Defined Type: openstack::patch

Defined in:
modules/openstack/manifests/patch.pp

Summary

applies a patch to the openstack source files

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • source (Stdlib::Filesource)

    Patch file source

  • file (Stdlib::Unixpath) (defaults to: $title)

    Filesystem path of the file to patch



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'modules/openstack/manifests/patch.pp', line 5

define openstack::patch (
  Stdlib::Filesource $source,
  Stdlib::Unixpath   $file   = $title,
) {
  ensure_packages(['patch'])

  $patch_file = "${file}.patch"
  file { $patch_file:
    ensure => file,
    source => $source,
    owner  => 'root',
    group  => 'root',
    mode   => '0444',
  }

  exec { "apply ${patch_file}":
    command => "/usr/bin/patch --forward ${file} ${patch_file}",
    unless  => "/usr/bin/patch --reverse --dry-run -f ${file} ${patch_file}",
    require => [File[$patch_file], Package['patch']],
  }
}