This file is indexed.

/usr/share/puppet/modules.available/puppetlabs-postgresql/lib/puppet/type/postgresql_conn_validator.rb is in puppet-module-puppetlabs-postgresql 5.3.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Puppet::Type.newtype(:postgresql_conn_validator) do
  @doc = "Verify that a connection can be successfully established between a node
          and the PostgreSQL server.  Its primary use is as a precondition to
          prevent configuration changes from being applied if the PostgreSQL
          server cannot be reached, but it could potentially be used for other
          purposes such as monitoring."

  ensurable do
    defaultvalues
    defaultto :present
  end

  newparam(:name, namevar: true) do
    desc 'An arbitrary name used as the identity of the resource.'
  end

  newparam(:db_name) do
    desc 'The name of the database you are trying to validate a connection with.'
  end

  newparam(:db_username) do
    desc 'A user that has access to the target PostgreSQL database.'
  end

  newparam(:db_password) do
    desc 'The password required to access the target PostgreSQL database.'
  end

  newparam(:host) do
    desc 'The DNS name or IP address of the server where PostgreSQL should be running.'
  end

  newparam(:port) do
    desc 'The port that the PostgreSQL server should be listening on.'

    validate do |value|
      Integer(value)
    end
    munge do |value|
      Integer(value)
    end
  end

  newparam(:connect_settings) do
    desc 'Hash of environment variables for connection to a db.'
  end

  newparam(:sleep) do
    desc 'The length of sleep time between connection tries.'

    validate do |value|
      Integer(value)
    end
    munge do |value|
      Integer(value)
    end

    defaultto 2
  end

  newparam(:tries) do
    desc 'The number of tries to validate the connection to the target PostgreSQL database.'

    validate do |value|
      Integer(value)
    end
    munge do |value|
      Integer(value)
    end

    defaultto 10
  end

  newparam(:psql_path) do
    desc 'Path to the psql command.'
  end

  newparam(:run_as) do
    desc 'System user that will run the psql command.'
  end

  newparam(:command) do
    desc 'Command to run against target database.'

    defaultto 'SELECT 1'
  end
end