Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Allow assignments to be conditional too #72

Closed

Description

@skx

Putting together some decent examples, in #66, made me consider how other people might approach problems.

I tend to use wget for downloading binaries, for example. But these days curl is perhaps more common.

It might be nice to support this:

let download=""

let download="/usr/bin/curl" if exists(/usr/bin/curl)
let download="/usr/bin/wget" if exists(/usr/bin/wget)

fail { message => "Can't find download program", if empty(download)}

Of course there's the obvious argument "If you want to use wget just .. install it":

package { name => "wget", state => "installed", name => "wget:package" }

shell { name => "download" , require => "wget:package" }

Still supporting conditionals in rules and includes does mean that assignments are the odd one out ..

Activity

  1. added a commit that references this issue on Jan 8, 2022
    330b6ca
  2. added a commit that references this issue on Jan 8, 2022
    df42792
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址