main.yaml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ---
  2. r_etcd_common_backup_tag: ''
  3. r_etcd_common_backup_sufix_name: ''
  4. l_is_etcd_system_container: "{{ (openshift_use_etcd_system_container | default(openshift_use_system_containers | default(false)) | bool) }}"
  5. # runc, docker, host
  6. r_etcd_common_etcd_runtime: "{{ 'runc' if l_is_etcd_system_container else 'docker' if l_is_containerized else 'host' }}"
  7. r_etcd_common_embedded_etcd: false
  8. osm_etcd_image: 'registry.access.redhat.com/rhel7/etcd'
  9. etcd_image_dict:
  10. origin: "registry.fedoraproject.org/f26/etcd"
  11. openshift-enterprise: "{{ osm_etcd_image }}"
  12. etcd_image: "{{ etcd_image_dict[openshift_deployment_type | default('origin')] }}"
  13. # etcd run on a host => use etcdctl command directly
  14. # etcd run as a docker container => use docker exec
  15. # etcd run as a runc container => use runc exec
  16. r_etcd_common_etcdctl_command: "{{ 'etcdctl' if r_etcd_common_etcd_runtime == 'host' or r_etcd_common_embedded_etcd | bool else 'docker exec etcd_container etcdctl' if r_etcd_common_etcd_runtime == 'docker' else 'runc exec etcd etcdctl' }}"
  17. # etcd server vars
  18. etcd_conf_dir: '/etc/etcd'
  19. etcd_conf_file: "{{ etcd_conf_dir }}/etcd.conf"
  20. etcd_ca_file: "{{ etcd_conf_dir }}/ca.crt"
  21. etcd_cert_file: "{{ etcd_conf_dir }}/server.crt"
  22. etcd_key_file: "{{ etcd_conf_dir }}/server.key"
  23. etcd_peer_ca_file: "{{ etcd_conf_dir }}/ca.crt"
  24. etcd_peer_cert_file: "{{ etcd_conf_dir }}/peer.crt"
  25. etcd_peer_key_file: "{{ etcd_conf_dir }}/peer.key"
  26. # etcd ca vars
  27. etcd_ca_dir: "{{ etcd_conf_dir}}/ca"
  28. etcd_generated_certs_dir: "{{ etcd_conf_dir }}/generated_certs"
  29. etcd_ca_cert: "{{ etcd_ca_dir }}/ca.crt"
  30. etcd_ca_key: "{{ etcd_ca_dir }}/ca.key"
  31. etcd_openssl_conf: "{{ etcd_ca_dir }}/openssl.cnf"
  32. etcd_ca_name: etcd_ca
  33. etcd_req_ext: etcd_v3_req
  34. etcd_ca_exts_peer: etcd_v3_ca_peer
  35. etcd_ca_exts_server: etcd_v3_ca_server
  36. etcd_ca_exts_self: etcd_v3_ca_self
  37. etcd_ca_exts_client: etcd_v3_ca_client
  38. etcd_ca_crl_dir: "{{ etcd_ca_dir }}/crl"
  39. etcd_ca_new_certs_dir: "{{ etcd_ca_dir }}/certs"
  40. etcd_ca_db: "{{ etcd_ca_dir }}/index.txt"
  41. etcd_ca_serial: "{{ etcd_ca_dir }}/serial"
  42. etcd_ca_crl_number: "{{ etcd_ca_dir }}/crlnumber"
  43. etcd_ca_default_days: 1825
  44. r_etcd_common_master_peer_cert_file: /etc/origin/master/master.etcd-client.crt
  45. r_etcd_common_master_peer_key_file: /etc/origin/master/master.etcd-client.key
  46. r_etcd_common_master_peer_ca_file: /etc/origin/master/master.etcd-ca.crt
  47. # etcd server & certificate vars
  48. etcd_hostname: "{{ inventory_hostname }}"
  49. etcd_ip: "{{ ansible_default_ipv4.address }}"
  50. etcd_is_atomic: False
  51. etcd_is_containerized: False
  52. etcd_is_thirdparty: False
  53. # etcd dir vars
  54. etcd_data_dir: "{{ '/var/lib/origin/openshift.local.etcd' if r_etcd_common_embedded_etcd | bool else '/var/lib/etcd/' }}"
  55. # etcd ports and protocols
  56. etcd_client_port: 2379
  57. etcd_peer_port: 2380
  58. etcd_url_scheme: http
  59. etcd_peer_url_scheme: http
  60. etcd_initial_cluster_state: new
  61. etcd_initial_cluster_token: etcd-cluster-1
  62. etcd_initial_advertise_peer_urls: "{{ etcd_peer_url_scheme }}://{{ etcd_ip }}:{{ etcd_peer_port }}"
  63. etcd_listen_peer_urls: "{{ etcd_peer_url_scheme }}://{{ etcd_ip }}:{{ etcd_peer_port }}"
  64. etcd_advertise_client_urls: "{{ etcd_url_scheme }}://{{ etcd_ip }}:{{ etcd_client_port }}"
  65. etcd_listen_client_urls: "{{ etcd_url_scheme }}://{{ etcd_ip }}:{{ etcd_client_port }}"
  66. # required role variable
  67. #etcd_peer: 127.0.0.1
  68. etcdctlv2: "etcdctl --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 }}"
  69. etcd_service: "{{ 'etcd_container' if r_etcd_common_etcd_runtime == 'docker' else 'etcd' }}"
  70. # Location of the service file is fixed and not meant to be changed
  71. etcd_service_file: "/etc/systemd/system/{{ etcd_service }}.service"
  72. r_etcd_firewall_enabled: "{{ os_firewall_enabled | default(True) }}"
  73. r_etcd_use_firewalld: "{{ os_firewall_use_firewalld | default(False) }}"
  74. etcd_systemd_dir: "/etc/systemd/system/{{ etcd_service }}.service.d"
  75. r_etcd_os_firewall_deny: []
  76. r_etcd_os_firewall_allow:
  77. - service: etcd
  78. port: "{{etcd_client_port}}/tcp"
  79. - service: etcd peering
  80. port: "{{ etcd_peer_port }}/tcp"
  81. # set the backend quota to 4GB by default
  82. etcd_quota_backend_bytes: 4294967296
  83. openshift_docker_service_name: "{{ 'container-engine' if (openshift_docker_use_system_container | default(False)) else 'docker' }}"