Skip to content

Commit 1d48cbc

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 d6a1941 commit 1d48cbc

13 files changed

Lines changed: 101 additions & 58 deletions

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/configure_ocp_abi.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
backend: cryptography
1414
private_key_format: ssh
1515

16-
- name: Copy pull secret to config directory for Ironic (connected mode)
17-
when: not (disconnected | default(true))
18-
ansible.builtin.copy:
19-
src: "{{ pullSecretPath }}"
20-
dest: "{{ workingDir }}/config/pull-secret.json"
21-
remote_src: true
22-
2316
- name: Extract openshift-install binary
2417
ansible.builtin.command: |
2518
{{ workingDir }}/bin/oc adm release extract --registry-config={{ pullSecretPath }} --command=openshift-install --to {{ workingDir }}/bin/

playbooks/tasks/deploy_bmo.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
- name: Get baremetal-operator image from OpenShift release
55
ansible.builtin.command: >
6-
{{ workingDir }}/bin/oc adm release info --registry-config={{ workingDir }}/config/pull-secret.json --image-for baremetal-operator
6+
{{ workingDir }}/bin/oc adm release info --registry-config={{ pullSecretPath }} --image-for baremetal-operator
77
quay.io/openshift-release-dev/ocp-release:{{ mgmt_openshift_version }}-x86_64
88
register: r_baremetal_operator_image
99
changed_when: false
@@ -38,7 +38,7 @@
3838
containers.podman.podman_container:
3939
name: baremetal-operator
4040
image: "{{ metal3_baremetal_operator_image }}"
41-
authfile: "{{ workingDir }}/config/pull-secret.json"
41+
authfile: "{{ pullSecretPath }}"
4242
user: "65532:65532"
4343
cap_drop:
4444
- ALL

playbooks/tasks/deploy_ironic.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
- name: Get ironic image from OpenShift release
55
ansible.builtin.command: >
6-
{{ workingDir }}/bin/oc adm release info --registry-config={{ workingDir }}/config/pull-secret.json --image-for ironic
6+
{{ workingDir }}/bin/oc adm release info --registry-config={{ pullSecretPath }} --image-for ironic
77
quay.io/openshift-release-dev/ocp-release:{{ mgmt_openshift_version }}-x86_64
88
register: r_ironic_image
99
changed_when: false
@@ -111,7 +111,7 @@
111111
name: ironic
112112
pod: metal3-ironic
113113
image: "{{ metal3_ironic_image }}"
114-
authfile: "{{ workingDir }}/config/pull-secret.json"
114+
authfile: "{{ pullSecretPath }}"
115115
restart_policy: always
116116
user: "1002:1003"
117117
cap_drop:
@@ -131,7 +131,7 @@
131131
name: httpd
132132
pod: metal3-ironic
133133
image: "{{ metal3_ironic_image }}"
134-
authfile: "{{ workingDir }}/config/pull-secret.json"
134+
authfile: "{{ pullSecretPath }}"
135135
restart_policy: always
136136
user: "1002:1003"
137137
cap_drop:

playbooks/tasks/deploy_metal3_stack.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
- name: Get ironic image from OpenShift release
55
ansible.builtin.command: >
6-
{{ workingDir }}/bin/oc adm release info --registry-config={{ workingDir }}/config/pull-secret.json --image-for ironic
6+
{{ workingDir }}/bin/oc adm release info --registry-config={{ pullSecretPath }} --image-for ironic
77
quay.io/openshift-release-dev/ocp-release:{{ mgmt_openshift_version }}-x86_64
88
register: r_ironic_image
99
changed_when: false
@@ -66,7 +66,7 @@
6666
name: ironic
6767
pod: metal3-ironic
6868
image: "{{ metal3_ironic_image }}"
69-
authfile: "{{ workingDir }}/config/pull-secret.json"
69+
authfile: "{{ pullSecretPath }}"
7070
restart_policy: always
7171
user: "1002:1003"
7272
cap_drop:
@@ -97,7 +97,7 @@
9797
name: httpd
9898
pod: metal3-ironic
9999
image: "{{ metal3_ironic_image }}"
100-
authfile: "{{ workingDir }}/config/pull-secret.json"
100+
authfile: "{{ pullSecretPath }}"
101101
restart_policy: always
102102
user: "1002:1003"
103103
cap_drop:

playbooks/tasks/mirror_registry.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
{{ workingDir }}/bin/mirror-registry install --quayHostname "{{ quayHostname }}" --quayRoot {{ workingDir }}/data --initPassword "{{ quayPassword }}" --initUser "{{ quayUser }}"
1414
register: r_mirror_registry
1515

16-
1716
- name: Generate pull secret for internal mirror
1817
ansible.builtin.set_fact:
1918
pullSecretInternal: '{"auths":{"{{ quayHostname }}:8443":{"auth":"{{ (quayUser + ":" + quayPassword) | ansible.builtin.b64encode }}"}}}'
@@ -25,7 +24,7 @@
2524
- name: Create pull-secret file with the combination
2625
ansible.builtin.copy:
2726
content: "{{ pullSecretNew }}"
28-
dest: "{{ workingDir }}/config/pull-secret.json"
27+
dest: "{{ pullSecretPath }}"
2928

3029
- name: Create pull-secret internal file with the combination
3130
ansible.builtin.copy:
@@ -42,7 +41,7 @@
4241

4342
- name: Start oc-mirror process
4443
ansible.builtin.shell: |
45-
{{ workingDir }}/bin/oc-mirror --v2 --log-level {{ ocMirrorLogLevel }} --authfile {{ workingDir }}/config/pull-secret.json -c {{ workingDir }}/config/imagesetconfiguration.yaml --workspace file://{{ workingDir }}/config/oc-mirror-workspace docker://{{ quayHostname }}:8443 --dest-tls-verify=false --parallel-images 10 --parallel-layers 10 --retry-times 10 --retry-delay 0 > {{ workingDir }}/logs/oc-mirror.progress.$(date +%s).log 2>&1
44+
{{ workingDir }}/bin/oc-mirror --v2 --log-level {{ ocMirrorLogLevel }} --authfile "{{ pullSecretPath }}" -c {{ workingDir }}/config/imagesetconfiguration.yaml --workspace file://{{ workingDir }}/config/oc-mirror-workspace docker://{{ quayHostname }}:8443 --dest-tls-verify=false --parallel-images 10 --parallel-layers 10 --retry-times 10 --retry-delay 0 > {{ workingDir }}/logs/oc-mirror.progress.$(date +%s).log 2>&1
4645
retries: 5
4746
delay: 10
4847
register: r_oc_mirror

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 }}"

0 commit comments

Comments
 (0)