-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- some of the post deployment steps from registry.rdoproject.org - configure the registry.distributed-ci.io Closes #1 Change-Id: If32684ad4b6ed6e3614970d41d22c60d48da9623
- Loading branch information
Showing
8 changed files
with
221 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
# Copyright Red Hat, Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
- name: Prepare the configuration of the OpenShift Standalone Registry | ||
hosts: masters | ||
become: yes | ||
tasks: | ||
- include_role: | ||
name: projects-creation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
# Copyright Red Hat, Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
registry_admins: | ||
- dmsimard | ||
- jpena | ||
- amoralej | ||
|
||
rdo_branches: | ||
- master | ||
- pike | ||
|
||
osp_branches: | ||
- osp12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
# Copyright Red Hat, Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
- name: Grant to cluster-admin privilege to the admin | ||
oc_adm_policy_user: | ||
user: '{{ item }}' | ||
resource_kind: cluster-role | ||
resource_name: cluster-admin | ||
state: present | ||
with_items: '{{ registry_admins }}' | ||
|
||
- name: Prepare the RDO configuration | ||
include: rdo.yml | ||
|
||
- name: Prepare the OSP/DCI configuration | ||
include: osp.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
# Copyright Red Hat, Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
- name: create the OSP projects | ||
oc_project: | ||
state: present | ||
name: 'rh{{ item }}' | ||
display_name: 'Red Hat {{ item }} images' | ||
with_items: '{{ osp_branches }}' | ||
|
||
- name: Create DCI service accounts | ||
oc_serviceaccount: | ||
state: present | ||
name: "dci-registry-user-{{ item }}.service" | ||
namespace: default | ||
with_items: '{{ osp_branches }}' | ||
|
||
- name: Grant to DCI users the ability to read their OSP images | ||
oc_adm_policy_user: | ||
user: 'system:serviceaccount:default:dci-registry-user-{{ item }}.service' | ||
resource_kind: role | ||
resource_name: registry-viewer | ||
state: present | ||
namespace: 'rh{{ item }}' | ||
with_items: '{{ osp_branches }}' | ||
|
||
- name: Create DCI admin service account | ||
oc_serviceaccount: | ||
state: present | ||
name: dci-registry-admin.service | ||
namespace: default | ||
|
||
- name: Grant to DCI admin service account the admin privileges for the OSP projects | ||
oc_adm_policy_user: | ||
user: system:serviceaccount:default:dci-registry-admin.service | ||
resource_kind: role | ||
resource_name: admin | ||
state: present | ||
namespace: 'rh{{ item }}' | ||
with_items: '{{ osp_branches }}' | ||
|
||
- name: Configure the reencrypt route for DCI image registry | ||
oc_route: | ||
name: docker-registry-dci | ||
namespace: default | ||
service_name: docker-registry | ||
tls_termination: 'reencrypt' | ||
host: 'registry.distributed-ci.io' | ||
cert_path: '/etc/letsencrypt/live/registry.distributed-ci.io/registry.distributed-ci.io-cert.pem' | ||
key_path: '/etc/letsencrypt/live/registry.distributed-ci.io/registry.distributed-ci.io-privkey.pem' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
# Copyright Red Hat, Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
- name: create the TripleO project | ||
oc_project: | ||
state: present | ||
name: '{{ item }}' | ||
display_name: "TripleO {{ item }} container images" | ||
with_items: '{{ rdo_branches }}' | ||
|
||
- name: create TripleO service account | ||
oc_serviceaccount: | ||
name: tripleo.service | ||
namespace: default | ||
|
||
- name: Grant to tripleo.service the admin privileges for the TripleO projects | ||
oc_adm_policy_user: | ||
user: system:serviceaccount:default:tripleo.service | ||
resource_kind: role | ||
resource_name: admin | ||
state: present | ||
namespace: '{{ item }}' | ||
with_items: '{{ rdo_branches }}' | ||
|
||
- name: create the rdo.pruner serviceaccount | ||
oc_serviceaccount: | ||
name: rdo.pruner | ||
namespace: default | ||
|
||
- name: Grant to rdo.pruner the system:image-pruner super power! | ||
oc_adm_policy_user: | ||
user: system:serviceaccount:default:rdo.pruner | ||
resource_kind: cluster-role | ||
resource_name: system:image-pruner | ||
state: present | ||
namespace: default | ||
|
||
- name: Allow authenticated users to pull images from the TripleO projects | ||
# Note: https://github.com/cockpit-project/cockpit/issues/6711 | ||
oc_adm_policy_group: | ||
group: system:authenticated | ||
resource_kind: role | ||
resource_name: registry-viewer | ||
state: present | ||
namespace: '{{ item }}' | ||
with_items: '{{ rdo_branches }}' | ||
|
||
- name: Allow unauthenticated users to browse the TripleO projects | ||
oc_adm_policy_group: | ||
group: system:unauthenticated | ||
resource_kind: role | ||
resource_name: registry-viewer | ||
state: present | ||
namespace: '{{ item }}' | ||
with_items: '{{ rdo_branches }}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters