main.yaml 4.8 KB

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