This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: cert-manager.io/v1 | |
| kind: ClusterIssuer | |
| metadata: | |
| name: vault-cluster-issuer | |
| spec: | |
| vault: | |
| path: pki/sign/<insert PKI issuer here> | |
| server: https://<insert Vault server here>:8200 | |
| caBundle: <base64 encoded caBundle PEM file> | |
| auth: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Secret | |
| type: Opaque | |
| metadata: | |
| name: cert-manager-vault-approle | |
| namespace: cert-manager | |
| data: | |
| secretId: "<insert base64 secret here>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| Description="HashiCorp Vault Agent" | |
| Documentation=https://www.vaultproject.io/docs/ | |
| Requires=network-online.target | |
| After=network-online.target | |
| ConditionFileNotEmpty=/vault-agent/vault-agent.hcl | |
| StartLimitIntervalSec=60 | |
| StartLimitBurst=3 | |
| [Service] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% if ansible_os_family == "Windows" %} | |
| {% raw %}{{ with secret "pki/issue/mdb-lab-dot-com" "ttl=86400s" {% endraw %}"common_name={{ ansible_fqdn }}" "ip_sans={{ ansible_ip_addresses[0] }}"{% raw %} }}{% endraw %} | |
| {% elif ansible_os_family == "RedHat" %} | |
| {% raw %}{{ with secret "pki/issue/mdb-lab-dot-com" "ttl=86400s" {% endraw %}"common_name={{ ansible_fqdn }}" "ip_sans={{ ansible_default_ipv4.address }}"{% raw %} }}{% endraw %} | |
| {% endif %} | |
| {% raw %} | |
| {{ .Data.certificate }} | |
| {{ end }} | |
| {% endraw %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% if ansible_os_family == "Windows" %} | |
| {% raw %}{{ with secret "pki/issue/mdb-lab-dot-com" "ttl=86400s" {% endraw %}"common_name={{ ansible_fqdn }}" "ip_sans={{ ansible_ip_addresses[0] }}"{% raw %} }}{% endraw %} | |
| {% elif ansible_os_family == "RedHat" %} | |
| {% raw %}{{ with secret "pki/issue/mdb-lab-dot-com" "ttl=86400s" {% endraw %}"common_name={{ ansible_fqdn }}" "ip_sans={{ ansible_default_ipv4.address }}"{% raw %} }}{% endraw %} | |
| {% endif %} | |
| {% raw %} | |
| {{ .Data.private_key }} | |
| {{ end }} | |
| {% endraw %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pid_file = "/vault-agent/agent.pid" | |
| vault { | |
| address = "{{ vault_server }}" | |
| tls_skip_verify = true | |
| } | |
| auto_auth { | |
| method "approle" { | |
| config = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - hosts: Linux | |
| tasks: | |
| - name: Add repository | |
| yum_repository: | |
| name: hashicorp | |
| file: hashicorp | |
| description: Hashicorp Stable - $basearch | |
| baseurl: https://rpm.releases.hashicorp.com/RHEL/$releasever/$basearch/stable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| path "pki/issue/mdb-lab-dot-com" { | |
| capabilities = ["create", "update"] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| path "auth/approle/role/sa_vault-agent/role-id" { | |
| capabilities = [ "read" ] | |
| } | |
| path "auth/approle/role/sa_vault-agent/secret-id" { | |
| capabilities = [ "create", "update" ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var jsonData = JSON.parse(responseBody); | |
| postman.setEnvironmentVariable("token", jsonData.auth.client_token); |