Created
November 26, 2016 02:08
-
-
Save anonymous/66e5a718523e7b56774c0d4d6abc4419 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Client Alive Interval | |
clientaliveinterval: | |
file.line: | |
- name: /etc/ssh/sshd_config | |
- content: 'ClientAliveInterval 900' | |
- match: '^#ClientAliveInterval' | |
- mode: ensure | |
# Client Alive Count Max | |
clientalivecountmax: | |
file.line: | |
- name: /etc/ssh/sshd_config | |
- content: 'ClientAliveCountMax 0' | |
- match: '^#ClientAliveCountMax' | |
- mode: ensure | |
---------- | |
ID: clientaliveinterval | |
Function: file.line | |
Name: /etc/ssh/sshd_config | |
Result: False | |
Comment: An exception occurred in this state: Traceback (most recent call last): | |
File "/usr/lib/python2.7/site-packages/salt/state.py", line 1733, in call | |
**cdata['kwargs']) | |
File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1652, in wrapper | |
return f(*args, **kwargs) | |
File "/usr/lib/python2.7/site-packages/salt/states/file.py", line 2724, in line | |
backup=backup, quiet=quiet, indent=indent) | |
File "/usr/lib/python2.7/site-packages/salt/modules/file.py", line 1627, in line | |
raise CommandExecutionError("Wrong conditions? " | |
CommandExecutionError: Wrong conditions? Unable to ensure line without knowing where to put it before and/or after. | |
Started: 19:02:47.358671 | |
Duration: 9.581 ms | |
Changes: | |
---------- | |
ID: clientalivecountmax | |
Function: file.line | |
Name: /etc/ssh/sshd_config | |
Result: False | |
Comment: An exception occurred in this state: Traceback (most recent call last): | |
File "/usr/lib/python2.7/site-packages/salt/state.py", line 1733, in call | |
**cdata['kwargs']) | |
File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1652, in wrapper | |
return f(*args, **kwargs) | |
File "/usr/lib/python2.7/site-packages/salt/states/file.py", line 2724, in line | |
backup=backup, quiet=quiet, indent=indent) | |
File "/usr/lib/python2.7/site-packages/salt/modules/file.py", line 1627, in line | |
raise CommandExecutionError("Wrong conditions? " | |
CommandExecutionError: Wrong conditions? Unable to ensure line without knowing where to put it before and/or after. | |
Started: 19:02:47.368427 | |
Duration: 0.817 ms | |
Changes: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's saying that if you use ensure, you need to specify a location to insert the line if it doesn't exist.
Try adding:
- location: end
To your states file. If the line doesn't already exist, it will append the line to the end of the file.