Skip to content

Commit a9bf45b

Browse files
committed
Add default deployment values
Add default values (in defaults/deployment.yaml) for: - disconnected: true - diskEncryption: false - ocMirrorLogLevel: info - pullSecretPath: "{{ workingDir }}/config/pull-secret.json" The variables have been removed from config/global.example.yaml but the defaults values can be overridden in config/global.yaml.
1 parent 82e27a1 commit a9bf45b

8 files changed

Lines changed: 91 additions & 40 deletions

File tree

config/global.example.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,31 +77,31 @@ blockStorageBackend: lvms
7777
# "kind": "ConfigMap", "data": ..}]'
7878

7979
# ============================================================================
80-
# OpenShift Configuration
80+
# OpenShift Deployment Configuration (optional)
81+
# All settings below have defaults. Uncomment only to override.
8182
# ============================================================================
82-
# Disconnected mode
83-
disconnected: true
83+
# Disconnected mode (default: true, set to false for connected deployments)
84+
# disconnected: false
8485

85-
# Encrypt installation partition with TPM v2
86-
diskEncryption: false
86+
# Encrypt installation partition with TPM v2 (default: false, set to true to enable)
87+
# diskEncryption: true
8788

88-
# SSH public key path for cluster nodes
89-
sshPubPath: "YOUR_SSH_PUB_KEY_PATH"
90-
91-
# Variables for oc-mirror
92-
ocMirrorLogLevel: debug
89+
# Log level for oc-mirror (default: info, options: trace, debug, info, error)
90+
# ocMirrorLogLevel: debug
9391

94-
# Additional NTP sources for cluster nodes (optional)
92+
# Additional NTP sources for cluster nodes (no additional servers by default)
9593
# defaultNtpServers:
9694
# - YOUR_NTP_SERVER_1
9795
# - YOUR_NTP_SERVER_2
9896

9997
# ============================================================================
100-
# Pull Secret Configuration
98+
# Pull Secret and SSH Public Key Configuration
10199
# ============================================================================
102100
# Obtain from: https://console.redhat.com/openshift/install/pull-secret
103101
pullSecret: '{"auths":{"YOUR_PULL_SECRET"}}'
104-
pullSecretPath: "{{ workingDir }}/config/pull-secret.json"
102+
103+
# SSH public key path for cluster nodes
104+
sshPubPath: "YOUR_SSH_PUB_KEY_PATH"
105105

106106
# ============================================================================
107107
# Cluster Hosts Configuration (Agent Hosts)

defaults/deployment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
# Default deployment mode. Override in config/global.yaml to deploy in connected mode.
3+
disconnected: true
4+
5+
# Default disk encryption setting. Override in config/global.yaml to enable TPM v2 encryption.
6+
diskEncryption: false
7+
8+
# Default oc-mirror log level. Override in config/global.yaml for more verbosity.
9+
ocMirrorLogLevel: info
10+
11+
# Default pull secret path. Override in config/global.yaml if stored elsewhere.
12+
pullSecretPath: "{{ workingDir }}/config/pull-secret.json"

docs/CONFIGURATION_REFERENCE.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -748,13 +748,15 @@ pullSecret: |
748748

749749
#### `pullSecretPath`
750750

751-
**Description**: Path to pull secret file (alternative to inline `pullSecret`).
751+
**Description**: Path to pull secret JSON file. Defaults to `{{ workingDir }}/config/pull-secret.json`. Override in `config/global.yaml` if your pull secret is stored elsewhere.
752752

753753
**Type**: String (file path)
754754

755+
**Default**: `{{ workingDir }}/config/pull-secret.json`
756+
755757
**Example**:
756758
```yaml
757-
pullSecretPath: "{{ workingDir }}/config/pull-secret.json"
759+
pullSecretPath: "{{ workingDir }}/.config/pull-secret.json"
758760
```
759761

760762
## Storage Configuration
@@ -1144,11 +1146,18 @@ defaultPrefix: 24
11441146
rendezvousIP: 192.168.2.24
11451147
lzBmcIP: 100.64.1.10
11461148
1147-
# OpenShift Configuration
1148-
disconnected: true
1149-
diskEncryption: false
1149+
# OpenShift Deployment Configuration (optional — uncomment only to override defaults)
1150+
# disconnected: false # Default: true (set to false for connected deployments)
1151+
# diskEncryption: true # Default: false (set to true to enable TPM v2 encryption)
1152+
# ocMirrorLogLevel: debug # Default: info
1153+
# defaultNtpServers: # No additional servers by default
1154+
# - YOUR_NTP_SERVER_1
1155+
# - YOUR_NTP_SERVER_2
1156+
1157+
# Pull Secret and SSH Public Key
1158+
pullSecret: '{"auths":{"cloud.openshift.com":{...},"quay.io":{...}}}'
1159+
# pullSecretPath: "{{ workingDir }}/config/pull-secret.json" # Default
11501160
sshPubPath: "{{ workingDir }}/.ssh/id_rsa.pub"
1151-
ocMirrorLogLevel: debug
11521161
11531162
# Storage Backend
11541163
blockStorageBackend: lvms
@@ -1187,9 +1196,6 @@ quayBackendRGWConfiguration:
11871196
bucket_name: quay-bucket-name
11881197
hostname: ocs-storagecluster-cephobjectstore-openshift-storage.apps.store.enclave-test.nodns.in
11891198
1190-
# Pull Secret
1191-
pullSecret: '{"auths":{"cloud.openshift.com":{...},"quay.io":{...}}}'
1192-
pullSecretPath: "{{ workingDir }}/config/pull-secret.json"
11931199
```
11941200

11951201
### `config/certificates.yaml`

playbooks/common/load-vars.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22

3+
- name: Include deployment defaults
4+
ansible.builtin.include_vars: ../../defaults/deployment.yaml
5+
36
- name: Include global deployment vars
47
ansible.builtin.include_vars: "{{ vars_file | default('../../config/global.yaml') }}"
58

playbooks/tasks/schema_validation.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
- name: validate defaults/deployment.yaml schema
2+
ansible.utils.validate:
3+
data: "{{ lookup('ansible.builtin.file', '../../defaults/deployment.yaml') | from_yaml | to_json }}"
4+
criteria: "{{ lookup('ansible.builtin.file', '../../schemas/deployment.yaml') | from_yaml | to_json }}"
5+
engine: ansible.utils.jsonschema
6+
17
- name: validate defaults/catalogs.yaml schema
28
ansible.utils.validate:
39
data: "{{ lookup('ansible.builtin.file', '../../defaults/catalogs.yaml') | from_yaml | to_json }}"

schemas/deployment.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
"$schema": "http://json-schema.org/draft-07/schema"
3+
version: "1.0"
4+
type: object
5+
6+
additionalProperties: false
7+
properties:
8+
disconnected:
9+
type: boolean
10+
description: >-
11+
Whether the deployment is disconnected (air-gapped). Default: true.
12+
Set to false for connected deployments.
13+
diskEncryption:
14+
type: boolean
15+
description: >-
16+
Whether to enable disk encryption using TPM v2. Default: false.
17+
Set to true to encrypt the installation partition on all nodes.
18+
ocMirrorLogLevel:
19+
type: string
20+
enum: [trace, debug, info, error]
21+
description: >-
22+
Log level for oc-mirror. Default: info.
23+
pullSecretPath:
24+
type: string
25+
description: >-
26+
Path to the pull secret JSON file. Default: {{ workingDir }}/config/pull-secret.json.
27+
28+
required:
29+
- disconnected
30+
- diskEncryption
31+
- ocMirrorLogLevel
32+
- pullSecretPath

scripts/generate_enclave_vars.sh

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -178,33 +178,25 @@ blockStorageBackend: lvms
178178
lvmsConfig: {}
179179
180180
# ============================================================================
181-
# OpenShift Configuration
181+
# OpenShift Deployment Configuration (optional)
182182
# ============================================================================
183-
# Disconnected mode
184-
disconnected: true
185-
186-
# Encrypt installation partition with TPM v2
187-
diskEncryption: false
188-
189-
# SSH public key path for cluster nodes
190-
sshPubPath: "{{ workingDir }}/.ssh/id_rsa.pub"
191-
192-
# Variables for oc-mirror
193-
ocMirrorLogLevel: info
194-
195-
# Additional NTP sources for cluster nodes (optional)
196-
defaultNtpServers: []
183+
# Leaving default values
197184
198185
# ============================================================================
199-
# Pull Secret Configuration
186+
# Pull Secret and SSH Public Key Configuration
200187
# ============================================================================
201188
# Obtain from: https://console.redhat.com/openshift/install/pull-secret
202189
# Pull secret will be read from pullSecretPath
203190
pullSecret:
204191
auths: {}
205192
pullSecretPath: "{{ workingDir }}/.config/pull-secret.json"
206193
207-
# Discovery hosts for hardware discovery (optional)
194+
# SSH public key path for cluster nodes
195+
sshPubPath: "{{ workingDir }}/.ssh/id_rsa.pub"
196+
197+
# ============================================================================
198+
# Discovery Hosts Configuration
199+
# ============================================================================
208200
# Add hosts here if you want to use the discovery feature
209201
discovery_hosts: []
210202

templates/agent-config.yaml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ rendezvousIP: {{ rendezvousIP }}
1010
# If defaultNtpServers are defined, add it to the configuration
1111
{% if defaultNtpServers | default("") | length > 0 %}
1212
additionalNTPSources:
13-
{{ defaultNtpServers | to_nice_yaml }}
13+
{{ defaultNtpServers | to_nice_yaml }}
1414
{% endif %}
1515

1616
# And we add the network configuration of each host, in nmstate format

0 commit comments

Comments
 (0)