Day 25 in the #vDM30in30 Image from https://flic.kr/p/6t59b
So, we’ve talked about the RAL, getters, setters and the resource command.
Now let’s talk about implementing a RAL interface of our own.
swap_file type and provider I ended up implementing a RAL layer in my swap_file module, mainly as an exercise in figuring out how types and providers work.
It looks like this:
Puppet::Type.type(:swap_file).provide(:linux) do desc "Swap file management via `swapon`, `swapoff` and `mkswap`" confine :kernel => :linux commands :swapon => 'swapon' commands :swapoff => 'swapoff' commands :mkswap => 'mkswap' mk_resource_methods def initialize(value={}) super(value) @property_flush = {} end def self.