Provider: ruby
- Defined in:
- lib/puppet/provider/archive/ruby.rb
- Resource type:
- archive
Overview
This provider implements a simple state-machine. The following attempts to # document it. In general, ‘def adjective?` implements a [state], while `def verb` implements an action. Some states are more complex, as they might depend on other states, or trigger actions. Since this implements an ad-hoc state-machine, many actions or states have to guard themselves against being called out of order.
- exists?
-
| v
- extracted?
-
-> no -> [checksum?]
|
v
yes
|
v
- path.exists?
-
-> no -> cleanup
| | |
v v v
- checksum?
-
yes. [extracted?] && [cleanup?]
| v {destroy}
Now, with [exists?] defined, we can define [ensure] But that’s just part of the standard puppet provider state-machine:
- ensure
-
-> absent -> [exists?] -> no.
| |
v v
present yes
| |
v v
- exists?
-
destroy
|
v
create
Here’s how we would extend archive for an ‘ensure => latest`:
[exists?] -> no -> {create}
|
v
yes
|
v
[ttl?] -> expired -> {destroy} -> {create}
|
v
valid.