main.yaml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. ---
  2. r_etcd_common_backup_tag: ''
  3. r_etcd_common_backup_sufix_name: ''
  4. l_etcd_static_pod: "{{ (inventory_hostname in groups['oo_masters']) | bool }}"
  5. # runc, docker, static pod, host
  6. r_etcd_common_etcd_runtime: "{{ 'static_pod' if l_etcd_static_pod else 'host' }}"
  7. r_etcd_default_version: "3.2.22"
  8. # lib_utils_oo_oreg_image is a custom filter defined in roles/lib_utils/filter_plugins/oo_filters.py
  9. # This filter attempts to combine oreg_url host with project/component from etcd_image_dict.
  10. # "oreg.example.com/openshift3/ose-${component}:${version}"
  11. # becomes "oreg.example.com/rhel7/etcd:{{ r_etcd_upgrade_version | default(r_etcd_default_version) }}"
  12. osm_etcd_image: "{{ etcd_image_dict[openshift_deployment_type] | lib_utils_oo_oreg_image((oreg_url | default('None'))) }}"
  13. etcd_image_dict:
  14. origin: "quay.io/coreos/etcd:v{{ r_etcd_upgrade_version | default(r_etcd_default_version) }}"
  15. openshift-enterprise: "registry.redhat.io/rhel7/etcd:{{ r_etcd_upgrade_version | default(r_etcd_default_version) }}"
  16. etcd_image: "{{ osm_etcd_image }}"
  17. # etcd run on a host => use etcdctl command directly
  18. etcdctl_dict:
  19. host: 'etcdctl'
  20. static_pod: '/usr/local/bin/master-exec etcd etcd etcdctl'
  21. r_etcd_common_etcdctl_command: "{{ etcdctl_dict[r_etcd_common_etcd_runtime] }}"
  22. # etcd server vars
  23. etcd_conf_dir: '/etc/etcd'
  24. etcd_conf_file: "{{ etcd_conf_dir }}/etcd.conf"
  25. etcd_ca_file: "{{ etcd_conf_dir }}/ca.crt"
  26. etcd_cert_file: "{{ etcd_conf_dir }}/server.crt"
  27. etcd_cert_subdir: "etcd-{{ openshift.common.hostname }}"
  28. etcd_key_file: "{{ etcd_conf_dir }}/server.key"
  29. etcd_peer_ca_file: "{{ etcd_conf_dir }}/ca.crt"
  30. etcd_peer_cert_file: "{{ etcd_conf_dir }}/peer.crt"
  31. etcd_peer_key_file: "{{ etcd_conf_dir }}/peer.key"
  32. # etcd ca vars
  33. etcd_ca_dir: "{{ etcd_conf_dir}}/ca"
  34. etcd_generated_certs_dir: "{{ etcd_conf_dir }}/generated_certs"
  35. etcd_cert_prefix: ''
  36. etcd_cert_config_dir: "/etc/etcd"
  37. etcd_ca_cert: "{{ etcd_ca_dir }}/ca.crt"
  38. etcd_ca_key: "{{ etcd_ca_dir }}/ca.key"
  39. etcd_openssl_conf: "{{ etcd_ca_dir }}/openssl.cnf"
  40. etcd_ca_name: etcd_ca
  41. etcd_req_ext: etcd_v3_req
  42. etcd_ca_exts_peer: etcd_v3_ca_peer
  43. etcd_ca_exts_server: etcd_v3_ca_server
  44. etcd_ca_exts_self: etcd_v3_ca_self
  45. etcd_ca_exts_client: etcd_v3_ca_client
  46. etcd_ca_crl_dir: "{{ etcd_ca_dir }}/crl"
  47. etcd_ca_new_certs_dir: "{{ etcd_ca_dir }}/certs"
  48. etcd_ca_db: "{{ etcd_ca_dir }}/index.txt"
  49. etcd_ca_serial: "{{ etcd_ca_dir }}/serial"
  50. etcd_ca_crl_number: "{{ etcd_ca_dir }}/crlnumber"
  51. etcd_ca_default_days: 1825
  52. r_etcd_common_master_peer_cert_file: /etc/origin/master/master.etcd-client.crt
  53. r_etcd_common_master_peer_key_file: /etc/origin/master/master.etcd-client.key
  54. r_etcd_common_master_peer_ca_file: /etc/origin/master/master.etcd-ca.crt
  55. # etcd server & certificate vars
  56. etcd_hostname: "{{ openshift.common.hostname }}"
  57. etcd_ip: "{{ openshift.common.ip }}"
  58. etcd_is_atomic: "{{ openshift_is_atomic }}"
  59. etcd_is_thirdparty: False
  60. # etcd dir vars
  61. etcd_data_dir: "/var/lib/etcd/"
  62. # etcd ports and protocols
  63. etcd_client_port: 2379
  64. etcd_peer_port: 2380
  65. etcd_url_scheme: https
  66. etcd_peer_url_scheme: https
  67. etcd_initial_cluster_state: new
  68. etcd_initial_cluster_token: etcd-cluster-1
  69. etcd_initial_advertise_peer_urls: "{{ etcd_peer_url_scheme }}://{{ etcd_ip }}:{{ etcd_peer_port }}"
  70. etcd_listen_peer_urls: "{{ etcd_peer_url_scheme }}://{{ etcd_ip }}:{{ etcd_peer_port }}"
  71. etcd_advertise_client_urls: "{{ etcd_url_scheme }}://{{ etcd_ip }}:{{ etcd_client_port }}"
  72. etcd_listen_client_urls: "{{ etcd_url_scheme }}://{{ etcd_ip }}:{{ etcd_client_port }}"
  73. # required role variable
  74. #etcd_peer: 127.0.0.1
  75. etcdctlv2: "{{ r_etcd_common_etcdctl_command }} --cert-file {{ etcd_peer_cert_file }} --key-file {{ etcd_peer_key_file }} --ca-file {{ etcd_peer_ca_file }} -C https://{{ etcd_peer }}:{{ etcd_client_port }}"
  76. etcd_service: etcd
  77. # Location of the service file is fixed and not meant to be changed
  78. etcd_service_file: "/etc/systemd/system/{{ etcd_service }}.service"
  79. r_etcd_firewall_enabled: "{{ os_firewall_enabled | default(True) }}"
  80. r_etcd_use_firewalld: "{{ os_firewall_use_firewalld | default(False) }}"
  81. etcd_systemd_dir: "/etc/systemd/system/{{ etcd_service }}.service.d"
  82. r_etcd_os_firewall_deny: []
  83. r_etcd_os_firewall_allow:
  84. - service: etcd
  85. port: "{{etcd_client_port}}/tcp"
  86. - service: etcd peering
  87. port: "{{ etcd_peer_port }}/tcp"
  88. # set the backend quota to 4GB by default
  89. etcd_quota_backend_bytes: 4294967296
  90. openshift_docker_service_name: "docker"
  91. etcd_ca_host: "{{ groups['oo_etcd_to_config'].0 }}"
  92. l_etcd_restart_command: "{{ l_etcd_static_pod | ternary('/usr/local/bin/master-restart etcd', 'systemctl restart etcd') }}"
  93. etcd_static_pod_location: "{{ openshift_control_plane_static_pod_location | default('/etc/origin/node/pods/') }}"