项目作者: ajanis

项目描述 :
ISC DHCP Server (used with Foreman)
高级语言:
项目地址: git://github.com/ajanis/ansible-isc_dhcp_server.git
创建时间: 2019-09-23T08:18:21Z
项目社区:https://github.com/ajanis/ansible-isc_dhcp_server

开源协议:

下载


Ansible-isc_dhcp_server

  • Requirements
  • Role Variables
  • Dependencies
  • Example Group Variables
  • Example Playbook
  • License
  • Author Information

Set up an ISC DHCP Server as part of the Foreman build server Project

This role is part of a project that will configure a Foreman build environment with optional TFTP and DHCP smart proxies, and an NGINX webserver for serving static content and acting as a reverse-proxy to Foreman.

Requirements

N/A

Role Variables

  1. isc_dhcp_server_omapi_port: 7911
  2. isc_dhcp_server_subnets:
  3. - name: "10.0.10.0/24"
  4. network: "10.0.10.0"
  5. mask: "255.255.255.0"
  6. gateway: "10.0.10.1"
  7. from_ip: "10.0.10.240"
  8. to_ip: "10.0.10.250"
  9. vlanid:
  10. mtu: 9000
  11. domains:
  12. - "{{ www_domain }}"
  13. dns_primary: 10.0.10.1
  14. dns_secondary:

Dependencies

Additonal variables may be set in group_vars for configuring Foreman, nginx, isc-dhcp server, and tftp server

Example Group Variables

  1. www_domain: home.example.com
  2. foreman_hostname: foreman
  3. fail2ban_enable: False
  4. nginx_backends:
  5. - service: foreman
  6. servers:
  7. - localhost:3000
  8. nginx_vhosts:
  9. - servername: "{{ foreman_hostname | default(ansible_hostname) + '.' + www_domain | default(ansible_domain) }}"
  10. serveralias: "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }}"
  11. serverlisten: 80
  12. locations:
  13. - name: /
  14. proxy: True
  15. backend: foreman
  16. - name: 404.html
  17. docroot: "/usr/share/nginx/html"
  18. - name: 50x.html
  19. docroot: "/usr/share/nginx/html"

PROTIP!! If deploying isc-dhcp-server as part of foreman setup, use foreman_proxy_dhcp_subnets in your group_vars to configure both isc-dhcp-server and foreman DHCP smart-proxy.

  1. foreman_proxy_dhcp_subnets:
  2. - name: "10.0.10.0/24"
  3. network: "10.0.10.0"
  4. mask: "255.255.255.0"
  5. gateway: "10.0.10.1"
  6. from_ip: "10.0.10.240"
  7. to_ip: "10.0.10.250"
  8. vlanid:
  9. mtu: 9000
  10. domains:
  11. - "{{ www_domain }}"
  12. dns_primary: 10.0.10.1
  13. dns_secondary:

Example Playbook

  1. - name: "Deploy Foreman Server"
  2. hosts: buildhost
  3. remote_user: root
  4. vars_files:
  5. - vault.yml
  6. tasks:
  7. - name: Wait for server to come online
  8. wait_for_connection:
  9. delay: 60
  10. sleep: 10
  11. connect_timeout: 5
  12. timeout: 900
  13. - include_role:
  14. name: common
  15. tags:
  16. - common
  17. - include_role:
  18. name: isc_dhcp_server
  19. public: yes
  20. apply:
  21. tags:
  22. - dhcp
  23. when: foreman_proxy_dhcp
  24. tags:
  25. - dhcp
  26. - include_role:
  27. name: tftp
  28. public: yes
  29. apply:
  30. tags:
  31. - tftp
  32. when: foreman_proxy_tftp
  33. tags:
  34. - tftp
  35. - include_role:
  36. name: nginx
  37. public: yes
  38. apply:
  39. tags:
  40. - nginx
  41. tags:
  42. - nginx
  43. - include_role:
  44. name: awx
  45. public: yes
  46. apply:
  47. tags:
  48. - awx
  49. tags:
  50. - awx
  51. - include_role:
  52. name: docker
  53. public: yes
  54. apply:
  55. tags:
  56. - docker
  57. tags:
  58. - docker
  59. - include_role:
  60. name: awx
  61. tasks_from: container-tasks.yml
  62. public: yes
  63. apply:
  64. tags:
  65. - awx
  66. tags:
  67. - awx
  68. - include_role:
  69. name: foreman
  70. public: yes
  71. tags:
  72. - install
  73. - configure
  74. - foreman
  75. - smartproxy
  76. - customize
  77. - include_role:
  78. name: ansible-project
  79. public: yes
  80. tags:
  81. - never
  82. - project
  83. - projectimport
  84. - projectclone

License

MIT

Author Information

Created by Alan Janis