From 4fa645a067cb9ea00b4b34776a55fd24d006a081 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 1 Mar 2026 21:41:21 +0200 Subject: Update content for html --- ...3-02-rcm-ruby-configuration-management-dsl.html | 73 +++++++++++---------- gemfeed/atom.xml | 75 ++++++++++++---------- 2 files changed, 81 insertions(+), 67 deletions(-) diff --git a/gemfeed/2026-03-02-rcm-ruby-configuration-management-dsl.html b/gemfeed/2026-03-02-rcm-ruby-configuration-management-dsl.html index bbef80b0..ce4ee1c3 100644 --- a/gemfeed/2026-03-02-rcm-ruby-configuration-management-dsl.html +++ b/gemfeed/2026-03-02-rcm-ruby-configuration-management-dsl.html @@ -35,6 +35,16 @@
  • Cutting RCM 0.1.0
  • What's next
  • Feature overview (selected)
  • +
  • ⇢ ⇢ Template rendering into a file
  • +
  • ⇢ ⇢ Ensuring a line is absent from a file
  • +
  • ⇢ ⇢ Guarding a configuration run on the current hostname
  • +
  • Creating and deleting directories, and purging a directory tree
  • +
  • ⇢ ⇢ Managing file and directory modes and ownership
  • +
  • ⇢ ⇢ Using a chained, more natural language style for notifications
  • +
  • ⇢ ⇢ Touching files and updating their timestamps
  • +
  • ⇢ ⇢ Expressing dependencies between notifications
  • +
  • ⇢ ⇢ Creating and updating symbolic links
  • +
  • ⇢ ⇢ Detecting duplicate resource definitions at configure time

  • Why I built RCM



    @@ -58,7 +68,7 @@ http://www.gnu.org/software/src-highlite --> given { hostname is :earth } file '/tmp/test/wg0.conf' do - requires '/etc/hosts.test' + requires file '/etc/hosts.test' manage directory from template 'content with <%= 1 + 2 %>' @@ -70,6 +80,22 @@ http://www.gnu.org/software/src-highlite --> end
    +Which would look like this when run:
    +
    + +
    % sudo ruby example.rb
    +INFO 20260301-213817 dsl(0) => Configuring...
    +INFO 20260301-213817 file('/tmp/test/wg0.conf') => Registered dependency on file('/etc/hosts.test')
    +INFO 20260301-213817 file('/tmp/test/wg0.conf') => Evaluating...
    +INFO 20260301-213817 file('/etc/hosts.test') => Evaluating...
    +INFO 20260301-213817 file('/etc/hosts.test') => Writing file /etc/hosts.test
    +INFO 20260301-213817 file('/tmp/test/wg0.conf') => Creating parent directory /tmp/test
    +INFO 20260301-213817 file('/tmp/test/wg0.conf') => Writing file /tmp/test/wg0.conf
    +
    +
    The idea is that you describe the desired state and RCM worries about the steps. The given block can short‑circuit the whole run (for example, only run on a specific hostname). Each file resource can either manage a complete file (from a template) or just make sure individual lines are present.

    Keywords and resources


    @@ -227,7 +253,7 @@ HostCondition.new.hostname.is(:earth)
    Some small examples adapted from RCM's own tests:

    -Template rendering into a file:
    +

    Template rendering into a file



    end
    -Ensuring a line is absent from a file:
    +

    Ensuring a line is absent from a file



    end
    -Keeping a backup of the original content when a file changes:
    -
    - -
    configure do
    -  file original do
    -    path './.dir_example.rcmtmp/foo/backup-me.txt'
    -    manage directory
    -    'original_content'
    -  end
    -
    -  file new do
    -    path './.dir_example.rcmtmp/foo/backup-me.txt'
    -    manage directory
    -    requires file original
    -    'new_content'
    -  end
    -end
    -
    -
    -Guarding a configuration run on the current hostname:
    +

    Guarding a configuration run on the current hostname



    configure do
       given { hostname Socket.gethostname }
    +  ...
     end
     

    -Creating and deleting directories, and purging a directory tree:
    +

    Creating and deleting directories, and purging a directory tree



    end
    -Managing file and directory modes and ownership:
    +

    Managing file and directory modes and ownership



    end
    -Using a chained, more natural language style for notifications:
    +

    Using a chained, more natural language style for notifications


    +
    +This will just print out something, not changing anything:

    end
    -Touching files and updating their timestamps:
    +

    Touching files and updating their timestamps



    end
    -Expressing dependencies between notifications:
    +

    Expressing dependencies between notifications



    end
    -Creating and updating symbolic links:
    +

    end
    -Detecting duplicate resource definitions at configure time:
    +

    Detecting duplicate resource definitions at configure time



    given { hostname is :earth } file '/tmp/test/wg0.conf' do - requires '/etc/hosts.test' + requires file '/etc/hosts.test' manage directory from template 'content with <%= 1 + 2 %>' @@ -77,6 +87,22 @@ http://www.gnu.org/software/src-highlite --> end
    +Which would look like this when run:
    +
    + +
    % sudo ruby example.rb
    +INFO 20260301-213817 dsl(0) => Configuring...
    +INFO 20260301-213817 file('/tmp/test/wg0.conf') => Registered dependency on file('/etc/hosts.test')
    +INFO 20260301-213817 file('/tmp/test/wg0.conf') => Evaluating...
    +INFO 20260301-213817 file('/etc/hosts.test') => Evaluating...
    +INFO 20260301-213817 file('/etc/hosts.test') => Writing file /etc/hosts.test
    +INFO 20260301-213817 file('/tmp/test/wg0.conf') => Creating parent directory /tmp/test
    +INFO 20260301-213817 file('/tmp/test/wg0.conf') => Writing file /tmp/test/wg0.conf
    +
    +
    The idea is that you describe the desired state and RCM worries about the steps. The given block can short‑circuit the whole run (for example, only run on a specific hostname). Each file resource can either manage a complete file (from a template) or just make sure individual lines are present.

    Keywords and resources


    @@ -234,7 +260,7 @@ HostCondition.new.hostname.is(:earth)
    Some small examples adapted from RCM's own tests:

    -Template rendering into a file:
    +

    Template rendering into a file



    end
    -Ensuring a line is absent from a file:
    +

    Ensuring a line is absent from a file



    end
    -Keeping a backup of the original content when a file changes:
    -
    - -
    configure do
    -  file original do
    -    path './.dir_example.rcmtmp/foo/backup-me.txt'
    -    manage directory
    -    'original_content'
    -  end
    -
    -  file new do
    -    path './.dir_example.rcmtmp/foo/backup-me.txt'
    -    manage directory
    -    requires file original
    -    'new_content'
    -  end
    -end
    -
    -
    -Guarding a configuration run on the current hostname:
    +

    Guarding a configuration run on the current hostname



    configure do
       given { hostname Socket.gethostname }
    +  ...
     end
     

    -Creating and deleting directories, and purging a directory tree:
    +

    Creating and deleting directories, and purging a directory tree



    end
    -Managing file and directory modes and ownership:
    +

    Managing file and directory modes and ownership



    end
    -Using a chained, more natural language style for notifications:
    +

    Using a chained, more natural language style for notifications


    +
    +This will just print out something, not changing anything:

    end
    -Touching files and updating their timestamps:
    +

    Touching files and updating their timestamps



    end
    -Expressing dependencies between notifications:
    +

    Expressing dependencies between notifications



    end
    -Creating and updating symbolic links:
    +

    end
    -Detecting duplicate resource definitions at configure time:
    +

    Detecting duplicate resource definitions at configure time