Skip to content

Instantly share code, notes, and snippets.

Created September 12, 2017 16:36
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 anonymous/f689af35076ea39bd4023b78f90f2c2e to your computer and use it in GitHub Desktop.
Save anonymous/f689af35076ea39bd4023b78f90f2c2e to your computer and use it in GitHub Desktop.
Salt error when using sysrc.managed
The salt state
Set the default firewall rule to accept:
sysrc.managed:
- name: net.inet.ip.fw.default_to_accept
- file: /tmp/loader.conf
- value: 1
The error
ID: Set the default firewall rule to accept
Function: sysrc.managed
Name: net.inet.ip.fw.default_to_accept
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/salt/state.py", line 1750, in call
**cdata['kwargs'])
File "/usr/local/lib/python2.7/site-packages/salt/loader.py", line 1705, in wrapper
return f(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/salt/states/sysrc.py", line 66, in managed
new_state = __salt__['sysrc.set'](name=name, value=value, **kwargs)
File "/usr/local/lib/python2.7/site-packages/salt/modules/sysrc.py", line 119, in set_
newval = sysrc.split(': ')[2].split(" -> ")[1]
IndexError: list index out of range
Started: 16:34:14.035828
Duration: 152.016 ms
Changes:
cat /tmp/loader.conf
net.inet.ip.fw.default_to_accept="1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment