main.yaml 3.7 KB

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