renew_nomad_certificates/tasks/configure.yml
Bertrand Lanson a4d952ef1a
All checks were successful
test / Linting (push) Successful in 10s
test / Molecule tests (default, debian12) (push) Successful in 1m8s
test / Molecule tests (default, debian11) (push) Successful in 1m9s
test / Molecule tests (default, ubuntu2004) (push) Successful in 1m20s
test / Molecule tests (default, ubuntu2204) (push) Successful in 1m23s
test / Molecule tests (with_custom_config, debian11) (push) Successful in 1m6s
test / Molecule tests (with_custom_config, debian12) (push) Successful in 1m9s
test / Molecule tests (with_custom_config, ubuntu2004) (push) Successful in 1m21s
test / Molecule tests (with_custom_config, ubuntu2204) (push) Successful in 1m21s
feat: add become, add vagrant tests, fix#1
2023-12-02 16:48:14 +01:00

51 lines
1.8 KiB
YAML

---
# task/configure file for renew_nomad_certificates
- name: "Configure files for nomad certificate renewal"
become: true
notify:
- "systemctl-enable-nomad-certs"
- "systemctl-restart-nomad-certs"
block:
- name: "Copy nomad_config.hcl template"
ansible.builtin.template:
src: nomad_config.hcl.j2
dest: "{{ renew_nomad_certificates_config_dir }}/nomad_config.hcl"
owner: "{{ renew_nomad_certificates_nomad_user }}"
group: "{{ renew_nomad_certificates_nomad_group }}"
mode: '0600'
- name: "Copy nomad_ca.pem.tpl template"
ansible.builtin.template:
src: nomad_ca.pem.tpl.j2
dest: "{{ renew_nomad_certificates_config_dir }}/templates/nomad_ca.pem.tpl"
owner: "{{ renew_nomad_certificates_nomad_user }}"
group: "{{ renew_nomad_certificates_nomad_group }}"
mode: '0600'
- name: "Copy nomad_cert.pem.tpl template"
ansible.builtin.template:
src: nomad_cert.pem.tpl.j2
dest: "{{ renew_nomad_certificates_config_dir }}/templates/nomad_cert.pem.tpl"
owner: "{{ renew_nomad_certificates_nomad_user }}"
group: "{{ renew_nomad_certificates_nomad_group }}"
mode: '0600'
- name: "Copy nomad_cert.key.tpl template"
ansible.builtin.template:
src: nomad_key.pem.tpl.j2
dest: "{{ renew_nomad_certificates_config_dir }}/templates/nomad_key.pem.tpl"
owner: "{{ renew_nomad_certificates_nomad_user }}"
group: "{{ renew_nomad_certificates_nomad_group }}"
mode: '0600'
- name: "Configure nomad-certs systemd service"
ansible.builtin.template:
src: nomad-certs.service.j2
dest: /etc/systemd/system/nomad-certs.service
owner: root
group: root
mode: '0644'
become: true
notify:
- "systemctl-daemon-reload"