This file is indexed.

/usr/share/puppet/modules.available/openstacklib/manifests/policy/base.pp is in puppet-module-openstacklib 9.4.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# == Definition: openstacklib::policy::base
#
# This resource configures the policy.json file for an OpenStack service
#
# == Parameters:
#
#  [*file_path*]
#    Path to the policy.json file
#    string; required
#
#  [*key*]
#    The key to replace the value for
#    string; required; the key to replace the value for
#
#  [*value*]
#    The value to set
#    string; optional; the value to set
#
define openstacklib::policy::base (
  $file_path,
  $key,
  $value = '',
) {

  # Add entry if it doesn't exists
  augeas { "${file_path}-${key}-${value}-add":
    lens    => 'Json.lns',
    incl    => $file_path,
    changes => [
      "set dict/entry[last()+1] \"${key}\"",
      "set dict/entry[last()]/string \"${value}\"",
    ],
    onlyif  => "match dict/entry[*][.=\"${key}\"] size == 0",
  }

  # Requires that the entry is added before this call or it will fail.
  augeas { "${file_path}-${key}-${value}" :
    lens    => 'Json.lns',
    incl    => $file_path,
    changes => "set dict/entry[*][.=\"${key}\"]/string \"${value}\"",
    require => Augeas["${file_path}-${key}-${value}-add"],
  }

}