From 9a0f7d1f2a55c86024d9d5a5b3db79aa10d7c783 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 1 Mar 2026 21:41:23 +0200 Subject: Update content for gemtext --- ...03-02-rcm-ruby-configuration-management-dsl.gmi | 67 ++++++++++--------- ...2-rcm-ruby-configuration-management-dsl.gmi.tpl | 57 ++++++++-------- gemfeed/atom.xml | 75 ++++++++++++---------- 3 files changed, 105 insertions(+), 94 deletions(-) (limited to 'gemfeed') diff --git a/gemfeed/2026-03-02-rcm-ruby-configuration-management-dsl.gmi b/gemfeed/2026-03-02-rcm-ruby-configuration-management-dsl.gmi index ee9b14be..c3fb639d 100644 --- a/gemfeed/2026-03-02-rcm-ruby-configuration-management-dsl.gmi +++ b/gemfeed/2026-03-02-rcm-ruby-configuration-management-dsl.gmi @@ -21,6 +21,16 @@ RCM is a tiny configuration management system written in Ruby. It gives me a sma * ⇢ ⇢ 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 @@ -41,7 +51,7 @@ configure do 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 %>' @@ -53,6 +63,19 @@ configure do end ``` +Which would look like this when run: + +```sh +% 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 @@ -192,7 +215,7 @@ Here is a quick overview of what RCM can do today, grouped by area: Some small examples adapted from RCM's own tests: -Template rendering into a file: +### Template rendering into a file ```ruby configure do @@ -203,7 +226,7 @@ configure do end ``` -Ensuring a line is absent from a file: +### Ensuring a line is absent from a file ```ruby configure do @@ -214,34 +237,16 @@ configure do end ``` -Keeping a backup of the original content when a file changes: - -```ruby -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 ```ruby 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 ```ruby configure do @@ -256,7 +261,7 @@ configure do end ``` -Managing file and directory modes and ownership: +### Managing file and directory modes and ownership ```ruby configure do @@ -270,7 +275,9 @@ configure do 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: ```ruby configure do @@ -280,7 +287,7 @@ configure do end ``` -Touching files and updating their timestamps: +### Touching files and updating their timestamps ```ruby configure do @@ -288,7 +295,7 @@ configure do end ``` -Expressing dependencies between notifications: +### Expressing dependencies between notifications ```ruby configure do @@ -306,7 +313,7 @@ configure do end ``` -Creating and updating symbolic links: +### Creating and updating symbolic links ```ruby configure do @@ -317,7 +324,7 @@ configure do end ``` -Detecting duplicate resource definitions at configure time: +### Detecting duplicate resource definitions at configure time ```ruby configure do diff --git a/gemfeed/2026-03-02-rcm-ruby-configuration-management-dsl.gmi.tpl b/gemfeed/2026-03-02-rcm-ruby-configuration-management-dsl.gmi.tpl index 0a83086b..234e78f0 100644 --- a/gemfeed/2026-03-02-rcm-ruby-configuration-management-dsl.gmi.tpl +++ b/gemfeed/2026-03-02-rcm-ruby-configuration-management-dsl.gmi.tpl @@ -27,7 +27,7 @@ configure do 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 %>' @@ -39,6 +39,19 @@ configure do end ``` +Which would look like this when run: + +```sh +% 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 @@ -178,7 +191,7 @@ Here is a quick overview of what RCM can do today, grouped by area: Some small examples adapted from RCM's own tests: -Template rendering into a file: +### Template rendering into a file ```ruby configure do @@ -189,7 +202,7 @@ configure do end ``` -Ensuring a line is absent from a file: +### Ensuring a line is absent from a file ```ruby configure do @@ -200,34 +213,16 @@ configure do end ``` -Keeping a backup of the original content when a file changes: - -```ruby -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 ```ruby 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 ```ruby configure do @@ -242,7 +237,7 @@ configure do end ``` -Managing file and directory modes and ownership: +### Managing file and directory modes and ownership ```ruby configure do @@ -256,7 +251,9 @@ configure do 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: ```ruby configure do @@ -266,7 +263,7 @@ configure do end ``` -Touching files and updating their timestamps: +### Touching files and updating their timestamps ```ruby configure do @@ -274,7 +271,7 @@ configure do end ``` -Expressing dependencies between notifications: +### Expressing dependencies between notifications ```ruby configure do @@ -292,7 +289,7 @@ configure do end ``` -Creating and updating symbolic links: +### Creating and updating symbolic links ```ruby configure do @@ -303,7 +300,7 @@ configure do end ``` -Detecting duplicate resource definitions at configure time: +### Detecting duplicate resource definitions at configure time ```ruby configure do diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index 671d0af8..4a366f82 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,6 +1,6 @@ - 2026-03-01T21:29:51+02:00 + 2026-03-01T21:39:39+02:00 foo.zone feed To be in the .zone! @@ -42,6 +42,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



    @@ -65,7 +75,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 %>' @@ -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