mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
--hard must be explicitly enbled
This commit is contained in:
parent
cd3ed419bb
commit
7e5000d654
@ -47,6 +47,14 @@ that exist but are not specified in the map file will be destroyed:
|
||||
|
||||
$ salt-cloud -m /path/to/mapfile -P -H
|
||||
|
||||
Be careful with this argument, it is very dangerous! In fact, it is so
|
||||
dangerous that in order to use it, you must explicitly enable it in the main
|
||||
configuration file.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
enable_hard_maps: True
|
||||
|
||||
A map file can include grains:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
@ -4,6 +4,7 @@ correct cloud modules
|
||||
'''
|
||||
# Import python libs
|
||||
import os
|
||||
import sys
|
||||
import copy
|
||||
import multiprocessing
|
||||
import logging
|
||||
@ -399,8 +400,15 @@ class Map(Cloud):
|
||||
if prov != 'aws' or pmap['aws'][name]['state'] != 2:
|
||||
ret['create'].pop(name)
|
||||
if self.opts['hard']:
|
||||
if self.opts['enable_hard_maps'] is True:
|
||||
# Look for the items to delete
|
||||
ret['destroy'] = exist.difference(defined)
|
||||
else:
|
||||
print('The --hard map can be extremely dangerous to use, and '
|
||||
'therefore must explicitly be enabled in the main'
|
||||
'configuration file, by setting enable_hard_maps to '
|
||||
'True')
|
||||
sys.exit(1)
|
||||
return ret
|
||||
|
||||
def run_map(self, dmap):
|
||||
|
Loading…
Reference in New Issue
Block a user