main.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ---
  2. # Default action when calling this role
  3. r_etcd_common_action: noop
  4. r_etcd_common_backup_tag: ''
  5. r_etcd_common_backup_sufix_name: ''
  6. # runc, docker, host
  7. r_etcd_common_etcd_runtime: "docker"
  8. r_etcd_common_embedded_etcd: false
  9. # etcd run on a host => use etcdctl command directly
  10. # etcd run as a docker container => use docker exec
  11. # etcd run as a runc container => use runc exec
  12. 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' }}"
  13. # etcd server vars
  14. etcd_conf_dir: '/etc/etcd'
  15. r_etcd_common_system_container_host_dir: /var/lib/etcd/etcd.etcd
  16. etcd_system_container_conf_dir: /var/lib/etcd/etc
  17. etcd_conf_file: "{{ etcd_conf_dir }}/etcd.conf"
  18. etcd_ca_file: "{{ etcd_conf_dir }}/ca.crt"
  19. etcd_cert_file: "{{ etcd_conf_dir }}/server.crt"
  20. etcd_key_file: "{{ etcd_conf_dir }}/server.key"
  21. etcd_peer_ca_file: "{{ etcd_conf_dir }}/ca.crt"
  22. etcd_peer_cert_file: "{{ etcd_conf_dir }}/peer.crt"
  23. etcd_peer_key_file: "{{ etcd_conf_dir }}/peer.key"
  24. # etcd ca vars
  25. etcd_ca_dir: "{{ etcd_conf_dir}}/ca"
  26. etcd_generated_certs_dir: "{{ etcd_conf_dir }}/generated_certs"
  27. etcd_ca_cert: "{{ etcd_ca_dir }}/ca.crt"
  28. etcd_ca_key: "{{ etcd_ca_dir }}/ca.key"
  29. etcd_openssl_conf: "{{ etcd_ca_dir }}/openssl.cnf"
  30. etcd_ca_name: etcd_ca
  31. etcd_req_ext: etcd_v3_req
  32. etcd_ca_exts_peer: etcd_v3_ca_peer
  33. etcd_ca_exts_server: etcd_v3_ca_server
  34. etcd_ca_exts_self: etcd_v3_ca_self
  35. etcd_ca_exts_client: etcd_v3_ca_client
  36. etcd_ca_crl_dir: "{{ etcd_ca_dir }}/crl"
  37. etcd_ca_new_certs_dir: "{{ etcd_ca_dir }}/certs"
  38. etcd_ca_db: "{{ etcd_ca_dir }}/index.txt"
  39. etcd_ca_serial: "{{ etcd_ca_dir }}/serial"
  40. etcd_ca_crl_number: "{{ etcd_ca_dir }}/crlnumber"
  41. etcd_ca_default_days: 1825
  42. r_etcd_common_master_peer_cert_file: /etc/origin/master/master.etcd-client.crt
  43. r_etcd_common_master_peer_key_file: /etc/origin/master/master.etcd-client.key
  44. r_etcd_common_master_peer_ca_file: /etc/origin/master/master.etcd-ca.crt
  45. # etcd server & certificate vars
  46. etcd_hostname: "{{ inventory_hostname }}"
  47. etcd_ip: "{{ ansible_default_ipv4.address }}"
  48. etcd_is_atomic: False
  49. etcd_is_containerized: False
  50. etcd_is_thirdparty: False
  51. # etcd dir vars
  52. 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/' }}"
  53. # etcd ports and protocols
  54. etcd_client_port: 2379
  55. etcd_peer_port: 2380
  56. etcd_url_scheme: http
  57. etcd_peer_url_scheme: http
  58. etcd_initial_cluster_state: new
  59. etcd_initial_cluster_token: etcd-cluster-1
  60. etcd_initial_advertise_peer_urls: "{{ etcd_peer_url_scheme }}://{{ etcd_ip }}:{{ etcd_peer_port }}"
  61. etcd_listen_peer_urls: "{{ etcd_peer_url_scheme }}://{{ etcd_ip }}:{{ etcd_peer_port }}"
  62. etcd_advertise_client_urls: "{{ etcd_url_scheme }}://{{ etcd_ip }}:{{ etcd_client_port }}"
  63. etcd_listen_client_urls: "{{ etcd_url_scheme }}://{{ etcd_ip }}:{{ etcd_client_port }}"
  64. etcd_systemd_dir: "/etc/systemd/system/{{ etcd_service }}.service.d"
  65. # etcd_peer needs to be set by a role caller
  66. 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 }}"