Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Add Disconnected registry option #185

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ def main(config, ipam, inv):
proxy_https=config.get('PROXY_HTTPS', ''),
proxy_noproxy=[item['dest'] for item in json.loads(config.get('PROXY_NOPROXY', '[]'))],
proxy_ca=config.get('PROXY_CA', ''),
cache_disk=config.get('CACHE_DISK', ''))
cache_disk=config.get('CACHE_DISK', ''),
local_registry_hostname=config.get('LOCAL_REGISTRY_HOSTNAME', ''))

inv.add_host('localhost',
ansible_connection='local',
Expand Down
3 changes: 2 additions & 1 deletion app/playbooks/config.d/cluster/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def __init__(self, path, footer, rtr_interfaces):
('mgmt_ip', 'Management IP'), ('mgmt_mac', 'Management MAC Address'),
('install_drive', 'OS Install Drive',
os.environ.get('BOOT_DRIVE'))]),
Parameter('CACHE_DISK', 'Container Cache Disk')])
Parameter('CACHE_DISK', 'Container Cache Disk'),
Parameter('LOCAL_REGISTRY_HOSTNAME', 'Local Registry with OCP Mirrored Images')])

stubbed_devices = json.loads(os.environ.get('BASTION_STUBBED_DEVICES', '{"items": []}'))['items']
if stubbed_devices:
Expand Down
1 change: 1 addition & 0 deletions app/playbooks/create.d/install-repos/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
openshift_installer_ssh_key: '{{ lookup("file", ansible_ssh_private_key_file + ".pub") }}'
openshift_installer_fips_mode: "{{ fips_mode }}"
openshift_installer_cache_disk: "{{ cache_disk }}"
openshift_installer_local_registry_hostname: "{{ local_registry_hostname }}"
openshift_installer_pull_secret: "{{ pull_secret | to_json }}"
openshift_installer_version: "{{ lookup('ini', 'installer section=cluster file=/app/versions.ini') }}"
openshift_installer_proxy: "{{ proxy }}"
Expand Down
1 change: 1 addition & 0 deletions app/roles/openshift-installer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ openshift_installer_proxy_ca: ""
openshift_installer_tang_public_key: ""
openshift_installer_tang_port: "80"
openshift_installer_tang_server: ""
openshift_installer_local_registry_hostname: ""
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ platform:
fips: {{ openshift_installer_fips_mode }}
pullSecret: '{{ openshift_installer_pull_secret }}'
sshKey: "{{ openshift_installer_ssh_key }}"
{% if openshift_installer_local_registry_hostname is defined and openshift_installer_local_registry_hostname|length %}
imageContentSources:
- mirrors:
- "{{ openshift_installer_local_registry_hostname }}/ocp4/ocp-release"
source: quay.io/openshift-release-dev/ocp-release
- mirrors:
- "{{ openshift_installer_local_registry_hostname }}/ocp4/ocp-v4.0-art-dev"
source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
{% endif %}