diff --git a/role_variables.md b/role_variables.md index e0f6630..a2f4b04 100644 --- a/role_variables.md +++ b/role_variables.md @@ -1010,11 +1010,6 @@ differences across distributions: - List of OS packages to install - Default value: list -## `vault_pkg` - -- Vault package filename -- Default value: `"{{ vault_version }}_linux_amd64.zip"` - ## `vault_debian_url` - Vault package download URL @@ -1133,7 +1128,7 @@ The role can configure HSM based instances. Make sure to reference the [HSM supp ## `vault_configure_enterprise_license` -- Manage enterprise license file with this role. Set to `true` to use `vault_license_path` or `vault_license_file`. +- Manage enterprise license file with this role. Set to `true` to use `vault_license_path`, and `vault_license_file` or `vault_license_content`. - Default value: false ## `vault_license_path` @@ -1143,7 +1138,12 @@ The role can configure HSM based instances. Make sure to reference the [HSM supp ## `vault_license_file` -- Path to enterprise license on the Ansible controller (source file for upload). Upload skipped when empty or undefined. Only used if `vault_configure_enterprise_license: true`. +- Path to enterprise license on the Ansible controller (source file for upload). Upload skipped when empty or undefined, if `vault_license_content` is also empty or undefined. Only used if `vault_configure_enterprise_license: true`. +- Default value: "" + +## `vault_license_content` + +- Path to enterprise license on the Ansible controller (source file for upload). Upload skipped when empty or undefined, if `vault_license_file` is also empty or undefined. Only used if `vault_configure_enterprise_license: true`. - Default value: "" ## `vault_hsm_app` diff --git a/tasks/main.yml b/tasks/main.yml index 8ac66df..e9364e8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -218,6 +218,18 @@ - vault_configure_enterprise_license | bool - vault_license_file | length > 0 +- name: Upload Vault license content to vault_license_path + become: true + copy: + content: "{{ vault_license_content }}" + dest: "{{ vault_license_path }}" + owner: "{{ vault_user }}" + group: "{{ vault_group }}" + mode: "{{ vault_harden_file_perms | ternary('0400', '0644') }}" + when: + - vault_configure_enterprise_license | bool + - vault_license_content | length > 0 + - name: "Set Exec output to log path when enabled log" set_fact: vault_exec_output: ">> {{ vault_log_path }}/vault.log 2>&1"