globsalt-projecttargeting

How to glob match minion in salt master for number containing more than one digit?


I just found out that I could not target minion using glob matching if the number to be matched is composed of more than one digit :

salt 'mail[1-4]*' test.ping

OK

salt 'mail[11-14]*' test.ping

Does NOT

I know I could use regxp switch for that, but I am just wondering if this is standard behaviour in salt ? (and in python by extension)

Thanks


Solution

  • Yes, this is standard behavior of shell-style globbing that's used in Salt. docs.

    You still can target minions with glob matching, you just have to glob each digit separately.

    salt 'mail[1-9][1-9]*' test.ping
    

    For details on glob see man 7 glob.