fastd.conf.j2 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #
  2. # This file is managed by ansible. Do not edit by hand!
  3. #
  4. bind {{item.bind}};
  5. include "secret.conf";
  6. interface "{{item.interface}}";
  7. log level {{item.loglevel|default('warn')}};
  8. {% if item.syslog_level is defined %}
  9. log to syslog level {{item.syslog_level}};
  10. {% endif %}
  11. {% if item.stderr_level is defined %}
  12. log to syslog level {{item.stderr_level}};
  13. {% endif %}
  14. mode {{item.mode}};
  15. method "{{item.method}}";
  16. peer limit {{item.peer_limit}};
  17. hide ip addresses {{item.hide_ip_addressess|default('yes')}};
  18. mtu {{item.mtu}};
  19. secure handshakes {{item.secure_handshake|default('yes')}};
  20. status socket "{{item.status_socket}}";
  21. user "{{fastd_user_name}}";
  22. drop capabilities {{item.drop_capabilities|default('yes')}};
  23. forward {{item.forward|default('no')}};
  24. hide mac addresses {{item.hide_mac_addresses|default('yes')}};
  25. {% if item.includes is defined %}
  26. {% for include in item.includes %}
  27. include {{include}};
  28. {% endfor %}
  29. {% endif %}
  30. {% if item.peer_includes is defined %}
  31. {% for include in item.peers %}
  32. {% if include.file is defined %}
  33. include peer "{{include.file}}" {% if include.name is defined %}[ as "{{include.name}}" ]{% endif %};
  34. {% endif %}
  35. {% endfor %}
  36. {% endif %}
  37. {% if item.peer_dir is defined %}
  38. include peers from "{{item.peer_dir}}";
  39. {% endif %}
  40. {% if item.mac is defined %}
  41. mac "{{item.mac.name}}" use "{{item.mac.implementation}}";
  42. {% endif %}
  43. {% if item.packet_mark is defined %}
  44. packet mark {{item.packet_mark}};
  45. {% endif %}
  46. {% if item.on_pre_up_script is defined %}
  47. on pre-up "
  48. {{item.on_pre_up_script}}
  49. ";
  50. {% endif %}
  51. {% if item.on_up_script is defined %}
  52. on up "
  53. {{item.on_up_script}}
  54. ";
  55. {% endif %}
  56. {% if item.on_verify_script is defined %}
  57. on verify "
  58. {{item.on_verify_script}}
  59. ";
  60. {% endif %}
  61. {% if item.on_down_script is defined %}
  62. on down "
  63. {{item.on_down_script}}
  64. ";
  65. {% endif %}
  66. {% if item.on_post_down_script is defined %}
  67. on post-down "
  68. {{item.on_post_down_script}}
  69. ";
  70. {% endif %}
  71. {% if item.on_connect_script is defined %}
  72. on connect "
  73. {{item.on_connect_script}}
  74. ";
  75. {% endif %}
  76. {% if item.on_establish_script is defined %}
  77. on establish "
  78. {{item.on_establish_script}}
  79. ";
  80. {% endif %}
  81. {% if item.on_disestablish_script is defined %}
  82. on disestablish "
  83. {{item.on_disestablish_script}}
  84. ";
  85. {% endif %}
  86. {% if item.peers is defined and item.peer_dir is not defined %}
  87. {% for peer in item.peers %}
  88. peer "{{peer.name}}" {
  89. };
  90. {% endfor %}
  91. {% endif %}
  92. {% if item.peer_groups is defined %}
  93. {% for peer_group in item.peer_groups %}
  94. peer group "{{peer_group-name}}" {
  95. };
  96. {% endfor %}
  97. {% endif %}