File: autorequire_cycle.pp

package info (click to toggle)
ruby-puppet-resource-api 1.8.16-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,228 kB
  • sloc: ruby: 9,519; sh: 4; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# test_module::autorequire_cycle
#
# This class is used to test autorequires.
# With make_cycle set to false, this should compile without errors or cycles. When make_cycle is set to true, autorequires will be used to
# construct a dependency cycle. This makes it possible to test exactly the function of the autorequires implementation.
#
# @summary This class is used to test autorequires.
#
# @example
#   include test_module::autorequire_cycle
class test_module::autorequire_cycle (
  Boolean $make_cycle
) {
  test_autorequire { 'a':
    target => 'b',
  }
  test_autorequire { 'b':
    target => 'c',
  }
  test_autorequire { 'c':
    target => $make_cycle ? { true => 'a', false => undef },
  }
}