Repository navigation
Closed
Labels
P3Priority 3PlatformRelates to OS, containers, platform-based utilities like FS, system based appsState-Modulebugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone
Description
When I use a state as follows:
saltstack-output-4505:
iptables.insert:
- position: -1
- chain: OUTPUT
- proto: tcp
- connstate: NEW
- jump: ACCEPT
- source: 0.0.0.0/0
- destination: 0.0.0.0/0
- dport: 4505
- table: filter
- match: state
- save: True
saltstack-output-4506:
iptables.insert:
- position: -1
- chain: OUTPUT
- proto: tcp
- connstate: NEW
- jump: ACCEPT
- source: 0.0.0.0/0
- destination: 0.0.0.0/0
- dport: 4506
- table: filter
- match: state
- save: True
It generates a cmd like so (when the chain is empty):
2015-05-19 23:33:47,226 [salt.loaded.int.module.cmdmod][INFO ][17413] Executing command '/sbin/iptables -t filter -C OUTPUT -p tcp -m state --state NEW --dport 4506 --destination 0.0.0.0/0 --source 0.0.0.0/0 --jump ACCEPT ' in directory '/root'
2015-05-19 23:33:47,233 [salt.loaded.int.module.cmdmod][ERROR ][17413] Command '/sbin/iptables -t filter -C OUTPUT -p tcp -m state --state NEW --dport 4506 --destination 0.0.0.0/0 --source 0.0.0.0/0 --jump ACCEPT ' failed with return code: 1
2015-05-19 23:33:47,233 [salt.loaded.int.module.cmdmod][ERROR ][17413] output: iptables: Bad rule (does a matching rule exist in that chain?).
2015-05-19 23:33:47,268 [salt.loaded.int.module.cmdmod][INFO ][17413] Executing command '/sbin/iptables --wait -t filter -I OUTPUT 0 -p tcp -m state --state NEW --dport 4506 --destination 0.0.0.0/0 --source 0.0.0.0/0 --jump ACCEPT ' in directory '/root'
2015-05-19 23:33:47,274 [salt.loaded.int.module.cmdmod][ERROR ][17413] Command '/sbin/iptables --wait -t filter -I OUTPUT 0 -p tcp -m state --state NEW --dport 4506 --destination 0.0.0.0/0 --source 0.0.0.0/0 --jump ACCEPT ' failed with return code: 2
2015-05-19 23:33:47,275 [salt.loaded.int.module.cmdmod][ERROR ][17413] output: iptables v1.4.21: Invalid rule number `0'
When I run the cmd from the box itself, the first one fails for some strange reason, but the second one generates a position of 0:
root@salt-minion-01:~# /sbin/iptables --wait -t filter -I OUTPUT 0 -p tcp -m state --state NEW --dport 4506 --destination 0.0.0.0/0 --source 0.0.0.0/0 --jump ACCEPT
iptables v1.4.21: Invalid rule number `0'
Try `iptables -h' or 'iptables --help' for more information.
Metadata
Metadata
Assignees
Labels
P3Priority 3PlatformRelates to OS, containers, platform-based utilities like FS, system based appsState-Modulebugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
neogenix commentedon May 20, 2015
Forgot to add some more info, here's my current iptables layout:
Salt Minions Version Report:
Salt Master Version Report:
neogenix commentedon May 20, 2015
In looking through the logs, it first does a -C, which then doesn't work (obviously), and then it tries with the position 0. Position should probably just be modified to 1, and it'll fix itself.
techhat commentedon May 20, 2015
Thanks again for the detailed report @neogenix. I agree, changing 0 to 1 seems like the right approach.
neogenix commentedon May 20, 2015
@techhat thanks! I'll see if I can find it shortly, and PR it.
neogenix commentedon May 20, 2015
@rallytime and @techhat PR's are in. Fairly simple 2 line fix. Tested on Ubuntu 15.04.
Merge pull request #23996 from neogenix/2015.5-23950
rallytime commentedon May 20, 2015
Awesome! Thanks @neogenix! I'll close this now since the PR against 2015.5 is merged and the one against develop will be merged when the tests are finished running (or merged forward...either way that code will be there).
neogenix commentedon May 21, 2015
@rallytime do you know off hand if they're going to be building an updated 2015.5.x package for Ubuntu?
Merge pull request #23999 from neogenix/develop-23950
rallytime commentedon May 21, 2015
We internally tagged and started testing 2015.5.1 yesterday, but I think we tagged it before your fixed was merged in. Therefore this fix should be in 2015.5.2, which should be about 2-3 weeks out from now for packages.