Repos with recipes to deploy some infrastructure services
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

84 Zeilen
2.4 KiB

  1. ---
  2. - block:
  3. - name: Ensure the override directory exists (systemd)
  4. file:
  5. name: "/etc/systemd/system/{{ pdns_rec_service_name }}.service.d"
  6. state: directory
  7. owner: root
  8. group: root
  9. - name: Override the PowerDNS Recursor unit (systemd)
  10. template:
  11. src: "override-service.systemd.conf.j2"
  12. dest: "/etc/systemd/system/{{ pdns_rec_service_name }}.service.d/override.conf"
  13. owner: root
  14. group: root
  15. notify: reload systemd and restart PowerDNS Recursor
  16. when: pdns_rec_service_overrides != {}
  17. and ansible_facts.service_mgr == "systemd"
  18. - name: Ensure that the PowerDNS Recursor configuration directory exists
  19. file:
  20. name: "{{ pdns_rec_config_dir }}"
  21. state: directory
  22. owner: root
  23. group: root
  24. mode: 0755
  25. - name: Generate the PowerDNS Recursor configuration
  26. template:
  27. src: recursor.conf.j2
  28. dest: "{{ pdns_rec_config_dir }}/{{ pdns_rec_config_file }}"
  29. owner: "root"
  30. group: "{{ pdns_rec_group }}"
  31. mode: 0640
  32. notify: restart PowerDNS Recursor
  33. - name: Ensure that the PowerDNS Recursor 'include-dir' directory exists
  34. file:
  35. name: "{{ pdns_rec_config['include-dir'] }}"
  36. state: directory
  37. owner: "root"
  38. group: "root"
  39. mode: 0755
  40. when: "pdns_rec_config['include-dir'] is defined"
  41. - name: Enable Syslog logging for PowerDns Recursors
  42. lineinfile:
  43. path: /usr/lib/systemd/system/pdns-recursor.service
  44. regexp: 'disable-syslog'
  45. line: "ExecStart=/usr/sbin/pdns_recursor --daemon=no --write-pid=no --log-timestamp=no"
  46. become: true
  47. become_method: sudo
  48. notify: reload systemd and restart PowerDNS Recursor
  49. - name: Configure syslog log rotation
  50. template:
  51. src: syslogrotate.conf.j2
  52. dest: "/etc/logrotate.d/syslog"
  53. become: true
  54. become_method: sudo
  55. - name: Generate the PowerDNS Recursor Lua config-file
  56. copy:
  57. dest: "{{ pdns_rec_config_lua }}"
  58. content: "{{ pdns_rec_config_lua_file_content }}"
  59. owner: "root"
  60. group: "{{ pdns_rec_group }}"
  61. mode: 0640
  62. notify: restart PowerDNS Recursor
  63. when: pdns_rec_config_lua_file_content != ""
  64. - name: Generate PowerDNS Recursor Lua dns-script
  65. copy:
  66. dest: "{{ pdns_rec_config_dns_script }}"
  67. content: "{{ pdns_rec_config_dns_script_file_content }}"
  68. owner: "root"
  69. group: "{{ pdns_rec_group }}"
  70. mode: 0640
  71. notify: restart PowerDNS Recursor
  72. when: pdns_rec_config_dns_script_file_content != ""