Skip to content

Commit 13a1d56

Browse files
Provide server CA certs to agents (#96)
* Provide server CA certs to agents * Improve variables
1 parent 2e389be commit 13a1d56

File tree

5 files changed

+25
-1
lines changed

5 files changed

+25
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ jobs:
128128
nginx_ssl_key_as_base64='true' \
129129
nginx_ssl_cert='${{ secrets.SSL_CERT }}' \
130130
nginx_ssl_key='${{ secrets.SSL_KEY }}' \
131+
agent_server_ca_cert='${{ secrets.SERVER_CA_CERT }}' \
132+
agent_server_ca_cert_as_base64='true' \
131133
install_method='${{ matrix.install_method }}'"
132134
--verbose
133135

README.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,13 @@ per-role basis if appropriate.
678678
`trento_rabbitmq_vhost`>
679679

680680
| agent_install_monitoring_dep | Whether to install monitoring dependencies like node_exporter or alloy | true
681+
682+
| agent_server_ca_cert | CA certificate of the Trento server, used to verify the
683+
server TLS certificate when connecting to it. This is required when ssl termination
684+
is enabled on the server side and the TLS is signed by a non-public CA. | undefined
685+
686+
| agent_server_ca_cert_as_base64 | Whether the `agent_server_ca_cert` variable is provided as a
687+
base64 string | false
681688
|===
682689

683690
*Postgres role*

roles/agent/defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ agent_rabbitmq_username: "{{ rabbitmq_username | default(trento_rabbitmq_usernam
77
agent_rabbitmq_password: "{{ rabbitmq_password | default(trento_rabbitmq_password) }}" # `rabbimtq_password` for backwards-compatibility
88
agent_rabbitmq_vhost: "{{ rabbitmq_vhost | default(trento_rabbitmq_vhost) }}" # `rabbimtq_vhost` for backwards-compatibility
99
agent_install_monitoring_dep: true
10+
agent_server_ca_cert: "{{ undef() }}"
11+
agent_server_ca_cert_as_base64: false

roles/agent/tasks/main.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@
2020
notify:
2121
- Restart Trento agent
2222

23+
- name: Add Server CA certificate PEM if provided
24+
no_log: false
25+
ansible.builtin.copy:
26+
content: "{{ (agent_server_ca_cert | b64decode) if agent_server_ca_cert_as_base64 | bool else agent_server_ca_cert }}"
27+
dest: "/etc/pki/trust/anchors/trento-server-ca.pem"
28+
mode: "0644"
29+
when: agent_server_ca_cert is defined
30+
31+
- name: Update CA trust store
32+
ansible.builtin.command: update-ca-certificates
33+
when: agent_server_ca_cert is defined
34+
changed_when: false
35+
2336
- name: Start Trento agent service
2437
ansible.builtin.service:
2538
name: trento-agent

roles/web/tasks/rpm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
- name: Start trento-web service
2323
ansible.builtin.service:
2424
name: trento-web
25-
state: started
25+
state: restarted
2626
enabled: true
2727

2828
- name: Wait for Web to be available

0 commit comments

Comments
 (0)