Skip to content

Instantly share code, notes, and snippets.

@PeterS242
Created March 17, 2016 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PeterS242/4941a1ecea1bfc045e76 to your computer and use it in GitHub Desktop.
Save PeterS242/4941a1ecea1bfc045e76 to your computer and use it in GitHub Desktop.
salt \* state.sls blockreplace_state test=true
...
minion01:
----------
ID: blockreplace_state
Function: file.blockreplace
Name: /etc/file
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/salt/state.py", line 1564, in call
**cdata['kwargs'])
File "/usr/lib/python2.6/site-packages/salt/states/file.py", line 2699, in blockreplace
show_changes=show_changes
File "/usr/lib/python2.6/site-packages/salt/modules/file.py", line 1762, in blockreplace
'Cannot edit marked block. Markers were not found in file.'
CommandExecutionError: Cannot edit marked block. Markers were not found in file.
Started: 10:25:39.061796
Duration: 17.933 ms
Changes:
Summary for minion01
------------
Succeeded: 0
Failed: 1
------------
Total states run: 1
...
salt minion01 state.sls blockreplace_state test=true
minion01:
----------
ID: blockreplace_state
Function: file.blockreplace
Name: /etc/file
Result: None
Comment: Changes would be made
Started: 10:34:59.664798
Duration: 9.59 ms
Changes:
----------
diff:
---
+++
...
Summary for minion01
------------
Succeeded: 1 (unchanged=1, changed=1)
Failed: 0
------------
Total states run: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment