Guest User

Untitled

a guest
Jul 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. bundle agent firewall_iptables_config {
  2. vars:
  3. "template" string => "$(sipx.SIPX_CONFDIR)/firewall/iptables.erb";
  4. "post_erb" string => "$(sipx.SIPX_TMPDIR)/iptables.post_erb";
  5. "iptables" string => "$(sipx.SIPX_TMPDIR)/iptables";
  6. "unapplied" string => "$(sipx.SIPX_TMPDIR)/iptables.unapplied";
  7. "data" string => "$(sipx.SIPX_CFDATA)/$(sipx.location_id)/firewall.yaml";
  8.  
  9. classes:
  10. "apply_iptables" expression => fileexists("$(unapplied)");
  11.  
  12. files:
  13. any::
  14. "$(post_erb)"
  15. comment => "Preprocess fireall template $(this.promiser)",
  16. create => "true",
  17. transformer => "$(sipx.SIPX_LIBEXECDIR)/sipx-config-maker \
  18. --in $(data) --out $(post_erb) --template $(template)";
  19.  
  20. "$(iptables)"
  21. comment => "Installing iptables config $(this.promoiser)",
  22. perms => mog("0644","root","root"),
  23. create => "true",
  24. edit_defaults => empty,
  25. edit_line => expand_template("$(post_erb)"),
  26. classes => if_repaired("new_iptables");
  27.  
  28. new_iptables::
  29. "$(unapplied)"
  30. create => "true",
  31. comment => "Outstanding iptables to install",
  32. copy_from => local_cp("$(iptables)"),
  33. classes => if_repaired("apply_iptables");
  34.  
  35. commands:
  36. apply_iptables.!unmanaged_firewall::
  37. "/sbin/iptables-restore"
  38. comment => "Install new firewall rules",
  39. contain => in_shell,
  40. args => "< $(unapplied) && /etc/init.d/iptables save && rm $(unapplied)";
  41. }
Add Comment
Please, Sign In to add comment