Skip to content

Latest commit

 

History

History
72 lines (55 loc) · 2.62 KB

README.md

File metadata and controls

72 lines (55 loc) · 2.62 KB

Dotbot Hostname Conditional Plugin
dotbot-ifhostname

License Programming Language CI Results Code Coverage

A plugin for conditional execution of Dotbot directives based on the hostname of the machine.

Inspired by dotbot-if and dotbot-ifplatform.

Prerequisites

This is a plugin for Dotbot, requiring it to be available.

Installation

  1. Add dotbot-ifhostname as a submodule to your dotfiles repository:
git submodule add https://github.com/johnlettman/dotbot-ifhostname.git
  1. Pass the CLI argument --plugin-dir path/to/dotbot-ifhostname when executing the dotbot command.

Usage

Add the ifhostname directive to the Dotbot YAML configuration file to conditionally execute the directives:

- ifhostname:
  hostname: computer-a
  met:
  - shell:
    - echo on computer A!

- ifhostname:
  hostname: computer-b
  met:
  - shell:
    - echo on computer B!
  unmet:
  - shell:
    - echo this isn't computer B!

Details

The following configuration options are available for the ifhostname directive:

Option Required Description
hostname Yes The hostname to match against.
met No Directives to execute when the hostname matches.
unmet No Directives to execute when the hostname does not match.