mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add rand-ver option
This commit is contained in:
parent
d5c23bdf8a
commit
d37afd1be8
1 changed files with 14 additions and 0 deletions
|
@ -38,6 +38,12 @@ OSES = [
|
|||
'AIX',
|
||||
'Solaris',
|
||||
]
|
||||
VERS = [
|
||||
'2014.1.6',
|
||||
'2014.7.4',
|
||||
'2015.5.5',
|
||||
'2015.8.0',
|
||||
]
|
||||
|
||||
|
||||
def parse():
|
||||
|
@ -77,6 +83,12 @@ def parse():
|
|||
default=False,
|
||||
action='store_true',
|
||||
help='Each Minion claims a different os grain')
|
||||
parser.add_option(
|
||||
'--rand-ver',
|
||||
dest='rand_ver',
|
||||
default=False,
|
||||
action='store_true',
|
||||
help='Each Minion claims a different version grain')
|
||||
parser.add_option(
|
||||
'-k',
|
||||
'--keep-modules',
|
||||
|
@ -300,6 +312,8 @@ class MinionSwarm(Swarm):
|
|||
|
||||
if self.opts['rand_os']:
|
||||
data['grains']['os'] = random.choice(OSES)
|
||||
if self.opts['rand_ver']:
|
||||
data['grains']['saltversion'] = random.choice(VERS)
|
||||
|
||||
with open(path, 'w+') as fp_:
|
||||
yaml.dump(data, fp_)
|
||||
|
|
Loading…
Add table
Reference in a new issue