Skip to content

Commit cc2c400

Browse files
authored
Merge pull request #172 from opencrvs/ocrvs-fixes-10951
fix: Minor bugfixes to infrastructure logic
2 parents 26b60e7 + de5ac31 commit cc2c400

File tree

5 files changed

+21
-45
lines changed

5 files changed

+21
-45
lines changed

infrastructure/environments/setup-environment.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,23 +1230,6 @@ ALL_QUESTIONS.push(
12301230
),
12311231
scope: 'ENVIRONMENT' as const
12321232
},
1233-
{
1234-
name: 'ENCRYPTION_KEY',
1235-
type: 'SECRET' as const,
1236-
didExist: findExistingValue(
1237-
'ENCRYPTION_KEY',
1238-
'SECRET',
1239-
'ENVIRONMENT',
1240-
existingValues
1241-
),
1242-
value: findExistingOrDefine(
1243-
'ENCRYPTION_KEY',
1244-
'SECRET',
1245-
'ENVIRONMENT',
1246-
generateLongPassword()
1247-
),
1248-
scope: 'ENVIRONMENT' as const
1249-
},
12501233
{
12511234
type: 'VARIABLE' as const,
12521235
name: 'ACTIVATE_USERS',
@@ -1357,6 +1340,25 @@ ALL_QUESTIONS.push(
13571340
}
13581341
]
13591342

1343+
if (enableEncryption){
1344+
applicationServerUpdates.push({
1345+
name: 'ENCRYPTION_KEY',
1346+
type: 'SECRET' as const,
1347+
didExist: findExistingValue(
1348+
'ENCRYPTION_KEY',
1349+
'SECRET',
1350+
'ENVIRONMENT',
1351+
existingValues
1352+
),
1353+
value: findExistingOrDefine(
1354+
'ENCRYPTION_KEY',
1355+
'SECRET',
1356+
'ENVIRONMENT',
1357+
generateLongPassword()
1358+
),
1359+
scope: 'ENVIRONMENT' as const
1360+
})
1361+
}
13601362

13611363
derivedUpdates.push(...applicationServerUpdates)
13621364

infrastructure/environments/templates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export function generateInventory(env: string, values: Record<string, any>){
109109
template = template.replace('{{BACKUP_BLOCK}}', backupBlock);
110110

111111
// Generate kube_api_host line
112-
let kubeApiHost = ' kube_api_host: ' + (values['kube_api_host'] || '');
112+
let kubeApiHost = 'kube_api_host: ' + (values['kube_api_host'] || '');
113113
template = template.replace('{{KUBE_API_HOST_BLOCK}}', kubeApiHost);
114114

115115
const updated = replacePlaceholders(template, values);

infrastructure/environments/templates/inventory/single-node.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ all:
55
# - If your server is exposed (not recommeded), use public IP address
66
# - If you would like to run kubectl commands from the remote server, leave this field empty
77
# kube_api_host: ''
8-
{{KUBE_API_HOST_BLOCK}}
8+
{{KUBE_API_HOST_BLOCK}}
99
# Default ansible provision user, keep as is
1010
ansible_user: provision
1111

infrastructure/server-setup/files/sshd_audit_hardening.22.04.conf

Lines changed: 0 additions & 10 deletions
This file was deleted.

infrastructure/server-setup/tasks/all/users.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -251,20 +251,6 @@
251251
marker: '# {mark} ANSIBLE MANAGED BLOCK FOR USER {{ ansible_user }}'
252252
become: yes
253253

254-
255-
# Add restriction configuration to sshd_config
256-
# For Ubuntu 22.04
257-
- name: SSHD Restrict key exchange, cipher, and MAC algorithms (Ubuntu 22.04)
258-
ansible.builtin.copy:
259-
src: ./files/sshd_audit_hardening.22.04.conf
260-
dest: /etc/ssh/sshd_config.d/audit_hardening.conf
261-
owner: root
262-
group: root
263-
mode: '0644'
264-
when:
265-
- ansible_facts['os_family'] == 'Debian'
266-
- ansible_facts['distribution'] == 'Ubuntu'
267-
- ansible_facts['distribution_version'] is version('22.04', '<=')
268254
# For Ubuntu 24.04
269255
- name: SSHD Restrict key exchange, cipher, and MAC algorithms (Ubuntu 24.04)
270256
ansible.builtin.copy:
@@ -309,5 +295,3 @@
309295
state: restarted
310296
when: ssh_status.rc == 0
311297
become: yes
312-
313-

0 commit comments

Comments
 (0)