ansible-hashistack/roles/consul/tasks/setup_server_cert.yml

20 lines
573 B
YAML
Raw Normal View History

2023-09-11 18:31:03 +02:00
---
- name: generate the server dc cert
ansible.builtin.command:
cmd: consul tls cert create -server -dc {{ consul_dc_name }} -ca /etc/consul/consul-agent-ca.pem
args:
chdir: /etc/consul
creates: "/etc/consul/{{ consul_dc_name }}-server-consul-0.pem"
become: true
- name: set permissions on generated files
ansible.builtin.file:
path: "{{ item }}"
mode: 0640
owner: consul
group: consul
become: true
loop:
- "/etc/consul/{{ consul_dc_name }}-server-consul-0.pem"
- "/etc/consul/{{ consul_dc_name }}-server-consul-0-key.pem"