Skip to content

Commit 463eb59

Browse files
committed
MAINT: Replace all occurrences of ssl with {{ env }}_ssl
As we need to generate certificates for distinct environments we must change the name of the SSL directory to a environment specific name so they don't use the same certificates. If we used the same certificates then when either deployment is compromised we would have to change certificates on both environments rather than one.
1 parent 8a76ccb commit 463eb59

File tree

13 files changed

+35
-33
lines changed

13 files changed

+35
-33
lines changed

chatops_deployment/ansible/roles/alertmanager/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
- name: Copy certificate and key
7878
become: true
7979
ansible.builtin.copy:
80-
src: "./SSL/alertmanager.{{ item }}"
80+
src: "./{{ env }}_ssl/alertmanager.{{ item }}"
8181
dest: "/opt/alertmanager/alertmanager.{{ item }}"
8282
owner: alertmanager
8383
group: alertmanager

chatops_deployment/ansible/roles/elastic/tasks/elasticsearch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
- name: Copy certificate and key
113113
become: true
114114
ansible.builtin.copy:
115-
src: "./SSL/elasticsearch.{{ item }}"
115+
src: "./{{ env }}_ssl/elasticsearch.{{ item }}"
116116
dest: "/opt/elasticsearch/config/elasticsearch.{{ item }}"
117117
owner: elastic
118118
group: elastic
@@ -124,7 +124,7 @@
124124
- name: Copy certificate and key
125125
become: true
126126
ansible.builtin.copy:
127-
src: "./SSL/elasticsearch.{{ item }}"
127+
src: "./{{ env }}_ssl/elasticsearch.{{ item }}"
128128
dest: "/opt/elasticsearch/config/elasticsearch.{{ item }}"
129129
owner: elastic
130130
group: elastic

chatops_deployment/ansible/roles/elastic/tasks/kibana.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
- name: Copy certificate and key
4141
become: true
4242
ansible.builtin.copy:
43-
src: "./SSL/{{ item }}"
43+
src: "./{{ env }}_ssl/{{ item }}"
4444
dest: "/opt/kibana/{{ item }}"
4545
owner: elastic
4646
group: elastic

chatops_deployment/ansible/roles/elastic/tasks/logstash.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
- name: Copy certificate and key
4141
become: true
4242
ansible.builtin.copy:
43-
src: "./SSL/{{ item }}"
43+
src: "./{{ env }}_ssl/{{ item }}"
4444
dest: "/opt/logstash/{{ item }}"
4545
owner: elastic
4646
group: elastic

chatops_deployment/ansible/roles/filebeat/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
- name: Copy Logstash SSL certificate
4242
become: true
4343
ansible.builtin.copy:
44-
src: "./SSL/logstash.crt"
44+
src: "./{{ env }}_ssl/logstash.crt"
4545
dest: "/opt/filebeat"
4646
owner: root
4747
group: root

chatops_deployment/ansible/roles/grafana/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
- name: Copy certificate and key
8080
become: true
8181
ansible.builtin.copy:
82-
src: "./SSL/grafana.{{ item }}"
82+
src: "./{{ env }}_ssl/grafana.{{ item }}"
8383
dest: "/etc/grafana/grafana.{{ item }}"
8484
owner: root
8585
group: grafana

chatops_deployment/ansible/roles/haproxy/tasks/haproxy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
path: /etc/haproxy/{{ domain }}.crt
2222
register: certificate_file
2323

24-
- name: Create SSL directory to store self signed certificates
24+
- name: Create ssl directory to store self signed certificates
2525
become: true
2626
ansible.builtin.file:
2727
path: /etc/haproxy/ssl
@@ -33,7 +33,7 @@
3333
- name: Copy service self signed certificates
3434
become: true
3535
ansible.builtin.copy:
36-
src: "./SSL/{{ item }}.crt"
36+
src: "./{{ env }}_ssl/{{ item }}.crt"
3737
dest: "/etc/haproxy/ssl/{{ item }}.crt"
3838
owner: root
3939
group: haproxy

chatops_deployment/ansible/roles/prometheus/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
- name: Copy certificate and key
105105
become: true
106106
ansible.builtin.copy:
107-
src: "./SSL/{{ item }}"
107+
src: "./{{ env }}_ssl/{{ item }}"
108108
dest: "/opt/prometheus/{{ item }}"
109109
owner: prometheus
110110
group: prometheus

chatops_deployment/ansible/roles/ssh_known_hosts/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# We must use shell here as here-docs don't work with command
1616
ansible.builtin.shell: |
1717
expect << EOF
18-
spawn ssh-add bastion-key
18+
spawn ssh-add {{ env }}-bastion-key
1919
expect "Enter passphrase for bastion-key:"
2020
send "{{ bastion_key_passphrase }}\r"
2121
expect eof

chatops_deployment/ansible/roles/ssl_certificates/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
- name: Create SSL directory
2+
- name: Create ssl directory
33
ansible.builtin.file:
4-
path: ./SSL
4+
path: ./{{ env }}_ssl
55
state: directory
66
owner: "{{ ansible_env.USER }}"
77
group: "{{ ansible_env.USER }}"

0 commit comments

Comments
 (0)