Skip to content
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
6 changes: 6 additions & 0 deletions roles/unsupported_operators/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# roles/unsupported_operators

## This role modifies registry.conf on machine config so that operators can be pulled by tag.

> Before running this role:
#### `registry_fqdn:` in `defaults/main.yml` should be set to users' registry FQDN, EX: `registry_fqdn: registry.sparta.rht-set.com`
2 changes: 2 additions & 0 deletions roles/unsupported_operators/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
registry_fqdn:
4 changes: 4 additions & 0 deletions roles/unsupported_operators/tasks/machine_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: apply machine config
community.kubernetes.k8s:
definition: "{{ lookup('template', 'templates/machine_config.j2') | from_yaml }}"
6 changes: 6 additions & 0 deletions roles/unsupported_operators/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: '{{ ansible_module | role:include_tasks | registry.yaml }}'
include_tasks: registry.yml

- name: '{{ ansible_module | role:include_tasks | machine_config.yaml }}'
include_tasks: machine_config.yml
4 changes: 4 additions & 0 deletions roles/unsupported_operators/tasks/registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: encode registry.conf
set_fact:
encoded_registry_conf: "{{ lookup('template', 'templates/registry.conf.j2') | b64encode }}"
26 changes: 26 additions & 0 deletions roles/unsupported_operators/templates/machine_config.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
annotations:
labels:
machineconfiguration.openshift.io/role: worker
name: 99-zworker-container-registry-conf
spec:
config:
ignition:
version: 3.2.0
storage:
files:
- contents:
source: data:text/plain;charset=utf-8;base64,{{ encoded_registry_conf }}
verification: {}
filesystem: root
mode: 420
overwrite: true
path: /etc/containers/registries.conf
extensions: null
fips: false
kernelArguments: null
kernelType: ""
osImageURL: ""
82 changes: 82 additions & 0 deletions roles/unsupported_operators/templates/registry.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
unqualified-search-registries = ["registry.access.redhat.com", "docker.io"]

[[registry]]
prefix = ""
location = "quay.io/openshift-release-dev/ocp-release"
mirror-by-digest-only = false

[[registry.mirror]]
location = "{{ registry_fqdn }}:5000/openshift-release-dev"

[[registry]]
prefix = ""
location = "quay.io/openshift-release-dev/ocp-v4.0-art-dev"
mirror-by-digest-only = false

[[registry.mirror]]
location = "{{ registry_fqdn }}:5000/openshift-release-dev"

[[registry]]
prefix = ""
location = "registry.redhat.io"
mirror-by-digest-only = false
insecure = true

[[registry.mirror]]
location = "{{ registry_fqdn }}:5000"
insecure = true

[[registry]]
prefix = ""
location = "quay.io"
mirror-by-digest-only = false
insecure = true

[[registry.mirror]]
location = "{{ registry_fqdn }}:5000"
insecure = true

[[registry]]
prefix = ""
location = "docker.io"
mirror-by-digest-only = false
insecure = true

[[registry.mirror]]
location = "{{ registry_fqdn }}:5000"
insecure = true

[[registry]]
prefix = ""
location = "registry.connect.redhat.com"
mirror-by-digest-only = false
insecure = true

[[registry.mirror]]
location = "{{ registry_fqdn }}:5000"
insecure = true

[[registry]]
prefix = ""
location = "gcr.io"
mirror-by-digest-only = false
insecure = true

[[registry.mirror]]
location = "{{ registry_fqdn }}:5000"
insecure = true

[[registry]]
prefix = ""
location = "registry.access.redhat.com"
mirror-by-digest-only = false
insecure = true

[[registry.mirror]]
location = "{{ registry_fqdn }}:5000"
insecure = true

[[registry]]
prefix = ""
location = "{{ registry_fqdn }}:5000"
insecure = true