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.

185 lines
5.9 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: "{{ etcd_access_addresses }}"
  41. # 8y default lease
  42. vault_default_lease_ttl: 70080h
  43. vault_max_lease_ttl: 87600h
  44. vault_temp_config:
  45. backend:
  46. file:
  47. path: /vault/file
  48. default_lease_ttl: "{{ vault_default_lease_ttl }}"
  49. listener:
  50. tcp:
  51. address: "{{ vault_bind_address }}:{{ vault_port }}"
  52. tls_disable: "true"
  53. max_lease_ttl: "{{ vault_max_lease_ttl }}"
  54. vault_config:
  55. backend:
  56. etcd:
  57. address: "{{ vault_etcd_url }}"
  58. ha_enabled: "true"
  59. redirect_addr: "https://{{ ansible_default_ipv4.address }}:{{ vault_port }}"
  60. tls_ca_file: "{{ vault_etcd_cert_dir }}/ca.pem"
  61. tls_cert_file: "{{ vault_etcd_cert_dir}}/node-{{ inventory_hostname }}.pem"
  62. tls_key_file: "{{ vault_etcd_cert_dir}}/node-{{ inventory_hostname }}-key.pem"
  63. cluster_name: "kubernetes-vault"
  64. default_lease_ttl: "{{ vault_default_lease_ttl }}"
  65. max_lease_ttl: "{{ vault_max_lease_ttl }}"
  66. listener:
  67. tcp:
  68. address: "{{ vault_bind_address }}:{{ vault_port }}"
  69. tls_cert_file: "{{ vault_cert_dir }}/api.pem"
  70. tls_key_file: "{{ vault_cert_dir }}/api-key.pem"
  71. vault_secret_shares: 1
  72. vault_secret_threshold: 1
  73. vault_ca_options:
  74. vault:
  75. common_name: vault
  76. format: pem
  77. ttl: "{{ vault_max_lease_ttl }}"
  78. exclude_cn_from_sans: true
  79. alt_names: "vault.kube-system.svc.{{ dns_domain }},vault.kube-system.svc,vault.kube-system,vault"
  80. etcd:
  81. common_name: etcd
  82. format: pem
  83. ttl: "{{ vault_max_lease_ttl }}"
  84. exclude_cn_from_sans: true
  85. kube:
  86. common_name: kube
  87. format: pem
  88. ttl: "{{ vault_max_lease_ttl }}"
  89. exclude_cn_from_sans: true
  90. front_proxy:
  91. common_name: front-proxy
  92. format: pem
  93. ttl: "{{ vault_max_lease_ttl }}"
  94. exclude_cn_from_sans: true
  95. vault_client_headers:
  96. Accept: "application/json"
  97. Content-Type: "application/json"
  98. vault_etcd_cert_dir: /etc/ssl/etcd/ssl
  99. vault_kube_cert_dir: /etc/kubernetes/ssl
  100. vault_pki_mounts:
  101. vault:
  102. name: vault
  103. default_lease_ttl: "{{ vault_default_lease_ttl }}"
  104. max_lease_ttl: "{{ vault_max_lease_ttl }}"
  105. description: "Vault Root CA"
  106. cert_dir: "{{ vault_cert_dir }}"
  107. roles:
  108. - name: vault
  109. group: vault
  110. password: "{{ lookup('password', inventory_dir + '/credentials/vault/vault.creds length=15') }}"
  111. policy_rules: default
  112. role_options: default
  113. etcd:
  114. name: etcd
  115. default_lease_ttl: "{{ vault_default_lease_ttl }}"
  116. max_lease_ttl: "{{ vault_max_lease_ttl }}"
  117. description: "Etcd Root CA"
  118. cert_dir: "{{ vault_etcd_cert_dir }}"
  119. roles:
  120. - name: etcd
  121. group: etcd
  122. password: "{{ lookup('password', inventory_dir + '/credentials/vault/etcd.creds length=15') }}"
  123. policy_rules: default
  124. role_options:
  125. allow_any_name: true
  126. enforce_hostnames: false
  127. organization: "kube:etcd"
  128. kube:
  129. name: kube
  130. default_lease_ttl: "{{ vault_default_lease_ttl }}"
  131. max_lease_ttl: "{{ vault_max_lease_ttl }}"
  132. description: "Kubernetes Root CA"
  133. cert_dir: "{{ vault_kube_cert_dir }}"
  134. roles:
  135. - name: kube-master
  136. group: kube-master
  137. password: "{{ lookup('password', inventory_dir + '/credentials/vault/kube-master.creds length=15') }}"
  138. policy_rules: default
  139. role_options:
  140. allow_any_name: true
  141. enforce_hostnames: false
  142. organization: "system:masters"
  143. - name: kube-node
  144. group: k8s-cluster
  145. password: "{{ lookup('password', inventory_dir + '/credentials/vault/kube-node.creds length=15') }}"
  146. policy_rules: default
  147. role_options:
  148. allow_any_name: true
  149. enforce_hostnames: false
  150. organization: "system:nodes"
  151. - name: kube-proxy
  152. group: k8s-cluster
  153. password: "{{ lookup('password', inventory_dir + '/credentials/vault/kube-proxy.creds length=15') }}"
  154. policy_rules: default
  155. role_options:
  156. allow_any_name: true
  157. enforce_hostnames: false
  158. organization: "system:node-proxier"
  159. front_proxy:
  160. name: front-proxy
  161. default_lease_ttl: "{{ vault_default_lease_ttl }}"
  162. max_lease_ttl: "{{ vault_max_lease_ttl }}"
  163. description: "Kubernetes Front Proxy CA"
  164. cert_dir: "{{ vault_kube_cert_dir }}"
  165. roles:
  166. - name: front-proxy-client
  167. group: k8s-cluster
  168. password: "{{ lookup('password', inventory_dir + '/credentials/vault/front-proxy-client.creds length=15') }}"
  169. policy_rules: default
  170. role_options:
  171. allow_any_name: true
  172. enforce_hostnames: false
  173. organization: "system:front-proxy"