enable_dnsmasq.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ---
  2. - include: evaluate_groups.yml
  3. - name: Load openshift_facts
  4. hosts: oo_masters_to_config:oo_nodes_to_config
  5. roles:
  6. - openshift_facts
  7. post_tasks:
  8. - fail: msg="This playbook requires a master version of at least Origin 1.1 or OSE 3.1"
  9. when: not openshift.common.version_gte_3_1_1_or_1_1_1 | bool
  10. - name: Reconfigure masters to listen on our new dns_port
  11. hosts: oo_masters_to_config
  12. handlers:
  13. - include: ../../../roles/openshift_master/handlers/main.yml
  14. vars:
  15. os_firewall_allow:
  16. - service: skydns tcp
  17. port: "{{ openshift.master.dns_port }}/tcp"
  18. - service: skydns udp
  19. port: "{{ openshift.master.dns_port }}/udp"
  20. roles:
  21. - os_firewall
  22. tasks:
  23. - openshift_facts:
  24. role: "{{ item.role }}"
  25. local_facts: "{{ item.local_facts }}"
  26. with_items:
  27. - role: common
  28. local_facts:
  29. use_dnsmasq: True
  30. - role: master
  31. local_facts:
  32. dns_port: '8053'
  33. - modify_yaml:
  34. dest: "{{ openshift.common.config_base }}/master/master-config.yaml"
  35. yaml_key: dnsConfig.bindAddress
  36. yaml_value: "{{ openshift.master.bind_addr }}:{{ openshift.master.dns_port }}"
  37. notify: restart master
  38. - meta: flush_handlers
  39. - name: Configure nodes for dnsmasq
  40. hosts: oo_nodes_to_config
  41. handlers:
  42. - include: ../../../roles/openshift_node/handlers/main.yml
  43. pre_tasks:
  44. - openshift_facts:
  45. role: "{{ item.role }}"
  46. local_facts: "{{ item.local_facts }}"
  47. with_items:
  48. - role: common
  49. local_facts:
  50. use_dnsmasq: True
  51. - role: node
  52. local_facts:
  53. dns_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
  54. vars:
  55. openshift_deployment_type: "{{ deployment_type }}"
  56. roles:
  57. - openshift_node_dnsmasq
  58. post_tasks:
  59. - modify_yaml:
  60. dest: "{{ openshift.common.config_base }}/node/node-config.yaml"
  61. yaml_key: dnsIP
  62. yaml_value: "{{ openshift.node.dns_ip }}"
  63. notify: restart node