Skip to content

Commit 7e3b008

Browse files
committed
skip ssl settings if already set
1 parent 33e4ed9 commit 7e3b008

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

infra/aggregation_mode/ansible/playbooks/gateway.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,24 @@
5353
vars:
5454
ansible_ssh_user: "{{ admin_user }}"
5555

56+
- name: Check if TLS certificate exists
57+
stat:
58+
path: "{{ gateway_tls_cert_path }}"
59+
register: tls_cert_stat
60+
61+
- name: Check if TLS key exists
62+
stat:
63+
path: "{{ gateway_tls_key_path }}"
64+
register: tls_key_stat
65+
5666
- name: Create SSL directory
5767
file:
5868
path: /home/{{ ansible_user }}/.ssl
5969
state: directory
6070
mode: '0700'
6171
owner: "{{ ansible_user }}"
6272
group: "{{ ansible_user }}"
73+
when: not tls_cert_stat.stat.exists or not tls_key_stat.stat.exists
6374

6475
- name: Copy TLS certificate
6576
copy:
@@ -68,6 +79,7 @@
6879
mode: '0600'
6980
owner: "{{ ansible_user }}"
7081
group: "{{ ansible_user }}"
82+
when: not tls_cert_stat.stat.exists
7183

7284
- name: Copy TLS key
7385
copy:
@@ -77,6 +89,7 @@
7789
owner: "{{ ansible_user }}"
7890
group: "{{ ansible_user }}"
7991
no_log: true
92+
when: not tls_key_stat.stat.exists
8093

8194
- name: Clone aligned_layer repository
8295
git:

0 commit comments

Comments
 (0)