-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcontain_stages.pp
38 lines (31 loc) · 1.11 KB
/
contain_stages.pp
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
# When do secondary classes float out of a stage?
# When unanchored and uncontained?
# ONLY if you also include the secondary class somewhere outside the first class; then it becomes a parse order race.
# When anchored?
# Parse order race: Will create dependency cycle if secondary class is also included outside.
# When contained?
# Parse order race: Will create dependency cycle if secondary class is also included outside.
class mine::secondary {
notify {"The notify in mine::secondary.":}
}
class mine {
notify {"The first notify in mine.":}
notify {"The second notify in mine.":}
include mine::secondary
# Anchor style:
# anchor {"one":} -> Class['mine::secondary'] -> anchor {"two":}
# Contain style:
contain mine::secondary
}
notify {"The first notify outside.":}
# Testing whether the secondary class will float out from between these two outside notifies:
# -> class {'mine':} ->
notify {"The last notify outside.":}
# Including the secondary class outside the main one, before the main one is declared
include mine::secondary
stage {'pre':
before => Stage['main'],
}
class {'mine':
stage => pre,
}