You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

167 lines
5.1 KiB

  1. ---
  2. vault_bootstrap: false
  3. vault_deployment_type: docker
  4. vault_adduser_vars:
  5. comment: "Hashicorp Vault User"
  6. createhome: no
  7. name: vault
  8. shell: /sbin/nologin
  9. system: yes
  10. # This variables redefined in kubespray-defaults for using shared tasks
  11. # in etcd and kubernetes/secrets roles
  12. vault_base_dir: /etc/vault
  13. vault_cert_dir: "{{ vault_base_dir }}/ssl"
  14. vault_config_dir: "{{ vault_base_dir }}/config"
  15. vault_roles_dir: "{{ vault_base_dir }}/roles"
  16. vault_secrets_dir: "{{ vault_base_dir }}/secrets"
  17. vault_log_dir: "/var/log/vault"
  18. vault_version: 0.8.1
  19. vault_binary_checksum: 3c4d70ba71619a43229e65c67830e30e050eab7a81ac6b28325ff707e5914188
  20. vault_download_url: "https://releases.hashicorp.com/vault/{{ vault_version }}/vault_{{ vault_version }}_linux_amd64.zip"
  21. vault_download_vars:
  22. container: "{{ vault_deployment_type != 'host' }}"
  23. dest: "vault/vault_{{ vault_version }}_linux_amd64.zip"
  24. enabled: true
  25. mode: "0755"
  26. owner: "vault"
  27. repo: "{{ vault_image_repo }}"
  28. sha256: "{{ vault_binary_checksum if vault_deployment_type == 'host' else vault_digest_checksum|d(none) }}"
  29. source_url: "{{ vault_download_url }}"
  30. tag: "{{ vault_image_tag }}"
  31. unarchive: true
  32. url: "{{ vault_download_url }}"
  33. version: "{{ vault_version }}"
  34. vault_container_name: kube-hashicorp-vault
  35. vault_temp_container_name: vault-temp
  36. vault_image_repo: "vault"
  37. vault_image_tag: "{{ vault_version }}"
  38. vault_bind_address: 0.0.0.0
  39. vault_port: 8200
  40. vault_etcd_url: "https://{{ hostvars[groups.etcd[0]]['ip']|d(hostvars[groups.etcd[0]]['ansible_default_ipv4']['address']) }}:2379"
  41. vault_default_lease_ttl: 720h
  42. vault_max_lease_ttl: 87600h
  43. vault_temp_config:
  44. backend:
  45. file:
  46. path: /vault/file
  47. default_lease_ttl: "{{ vault_default_lease_ttl }}"
  48. listener:
  49. tcp:
  50. address: "{{ vault_bind_address }}:{{ vault_port }}"
  51. tls_disable: "true"
  52. max_lease_ttl: "{{ vault_max_lease_ttl }}"
  53. vault_config:
  54. backend:
  55. etcd:
  56. address: "{{ vault_etcd_url }}"
  57. ha_enabled: "true"
  58. redirect_addr: "https://{{ ansible_default_ipv4.address }}:{{ vault_port }}"
  59. tls_ca_file: "{{ vault_etcd_cert_dir }}/ca.pem"
  60. cluster_name: "kubernetes-vault"
  61. default_lease_ttl: "{{ vault_default_lease_ttl }}"
  62. max_lease_ttl: "{{ vault_max_lease_ttl }}"
  63. listener:
  64. tcp:
  65. address: "{{ vault_bind_address }}:{{ vault_port }}"
  66. tls_cert_file: "{{ vault_cert_dir }}/api.pem"
  67. tls_key_file: "{{ vault_cert_dir }}/api-key.pem"
  68. vault_secret_shares: 1
  69. vault_secret_threshold: 1
  70. vault_ca_options:
  71. vault:
  72. common_name: vault
  73. format: pem
  74. ttl: "{{ vault_max_lease_ttl }}"
  75. exclude_cn_from_sans: true
  76. altnames:
  77. - "vault.{{ system_namespace }}.svc.{{ dns_domain }}"
  78. - "vault.{{ system_namespace }}.svc"
  79. - "vault.{{ system_namespace }}"
  80. - "vault"
  81. etcd:
  82. common_name: etcd
  83. format: pem
  84. ttl: "{{ vault_max_lease_ttl }}"
  85. exclude_cn_from_sans: true
  86. kube:
  87. common_name: kube
  88. format: pem
  89. ttl: "{{ vault_max_lease_ttl }}"
  90. exclude_cn_from_sans: true
  91. vault_client_headers:
  92. Accept: "application/json"
  93. Content-Type: "application/json"
  94. vault_etcd_cert_dir: /etc/ssl/etcd/ssl
  95. vault_kube_cert_dir: /etc/kubernetes/ssl
  96. vault_pki_mounts:
  97. vault:
  98. name: vault
  99. default_lease_ttl: "{{ vault_default_lease_ttl }}"
  100. max_lease_ttl: "{{ vault_max_lease_ttl }}"
  101. description: "Vault Root CA"
  102. cert_dir: "{{ vault_cert_dir }}"
  103. roles:
  104. - name: vault
  105. group: vault
  106. password: "{{ lookup('password', 'credentials/vault/vault length=15') }}"
  107. policy_rules: default
  108. role_options: default
  109. etcd:
  110. name: etcd
  111. default_lease_ttl: "{{ vault_default_lease_ttl }}"
  112. max_lease_ttl: "{{ vault_max_lease_ttl }}"
  113. description: "Etcd Root CA"
  114. cert_dir: "{{ vault_etcd_cert_dir }}"
  115. roles:
  116. - name: etcd
  117. group: etcd
  118. password: "{{ lookup('password', 'credentials/vault/etcd length=15') }}"
  119. policy_rules: default
  120. role_options:
  121. allow_any_name: true
  122. enforce_hostnames: false
  123. organization: "kube:etcd"
  124. kube:
  125. name: kube
  126. default_lease_ttl: "{{ vault_default_lease_ttl }}"
  127. max_lease_ttl: "{{ vault_max_lease_ttl }}"
  128. description: "Kubernetes Root CA"
  129. cert_dir: "{{ vault_kube_cert_dir }}"
  130. roles:
  131. - name: kube-master
  132. group: kube-master
  133. password: "{{ lookup('password', 'credentials/vault/kube-master length=15') }}"
  134. policy_rules: default
  135. role_options:
  136. allow_any_name: true
  137. enforce_hostnames: false
  138. organization: "system:masters"
  139. - name: kube-node
  140. group: k8s-cluster
  141. password: "{{ lookup('password', 'credentials/vault/kube-node length=15') }}"
  142. policy_rules: default
  143. role_options:
  144. allow_any_name: true
  145. enforce_hostnames: false
  146. organization: "system:nodes"
  147. - name: kube-proxy
  148. group: k8s-cluster
  149. password: "{{ lookup('password', 'credentials/vault/kube-proxy length=15') }}"
  150. policy_rules: default
  151. role_options:
  152. allow_any_name: true
  153. enforce_hostnames: false
  154. organization: "system:node-proxier"