diff --git a/files/osbs/atomic-reactor.repo b/files/osbs/atomic-reactor.repo new file mode 100644 index 0000000000..b19cde06b3 --- /dev/null +++ b/files/osbs/atomic-reactor.repo @@ -0,0 +1,8 @@ +[atomic-reactor] +name=Copr repo for atomic-reactor owned by maxamillion +baseurl=https://copr-be.cloud.fedoraproject.org/results/maxamillion/atomic-reactor/epel-7-$basearch/ +skip_if_unavailable=True +gpgcheck=1 +gpgkey=https://copr-be.cloud.fedoraproject.org/results/maxamillion/atomic-reactor/pubkey.gpg +enabled=1 +enabled_metadata=1 diff --git a/files/osbs/osbs.conf b/files/osbs/osbs.conf new file mode 100644 index 0000000000..8284b7b5a1 --- /dev/null +++ b/files/osbs/osbs.conf @@ -0,0 +1,18 @@ +[general] +build_json_dir = /usr/share/osbs/ + +[default] +openshift_uri = https://losbs.example.com:8443/ +# if you want to get packages from koji (koji plugin in dock) +# you need to setup koji hub and root +# this sample is for fedora +koji_root = http://koji.fedoraproject.org/ +koji_hub = http://koji.fedoraproject.org/kojihub +# in case of using artifacts plugin, you should provide a command +# how to fetch artifacts +sources_command = fedpkg sources +# from where should be images pulled and where should be pushed? +# registry_uri = your.example.registry +registry_uri = localhost:5000 +verify_ssl = false +build_type = simple diff --git a/playbooks/groups/osbs.yml b/playbooks/groups/osbs.yml index 77d1551f29..177cd32945 100644 --- a/playbooks/groups/osbs.yml +++ b/playbooks/groups/osbs.yml @@ -98,3 +98,62 @@ state: started enabled: yes +- name: atomic-reactor install and config + hosts: openshift_masters + user: root + gather_facts: False + + tasks: + - name: Configure the atomic-reactor COPR + copy: + src: osbs/atomic-reactor.repo + dest: /etc/yum/repos.d/atomic-reactor.repo + + - name: Install atomic-reactor + yum: pkg=atomic-reactor state=present + + - name: Build atomic-reactor base image + shell: atomic-reactor create-build-image --reactor-tarball-path /usr/share/atomic-reactor/atomic-reactor.tar.gz /usr/share/atomic-reactor/images/dockerhost-builder buildroot + +- name: atomic-reactor install and config + hosts: openshift_masters + user: root + gather_facts: False + + tasks: + - name: Tag the buildroot for builder local registry + shell: docker tag buildroot localhost:5000/buildroot + + - name: Push the buildroot to builder local registry + shell: docker push localhost:5000/buildroot + + - name: Pull fedora docker image + shell: docker pull fedora + + - name: Tag fedora for builder local registry + shell: docker tag fedora localhost:5000/fedora + + - name: Push the fedora image to builder local registry + shell: docker push localhost:5000/fedora + +- name: OSBS Configuration - OpenShift Auth + hosts: openshift_masters + user: root + gather_facts: False + + tasks: + - name: Set role-to-group for OSBS system:unauthenticated + shell: oadm policy add-role-to-group edit system:unauthenticated system:authenticated + - name: Set role-to-group for OSBS system:authenticated + shell: oadm policy add-role-to-group edit system:authenticated + +- name: OSBS Client tools config + hosts: openshift_masters:openshift_nodes + user: root + gather_facts: False + + tasks: + - copy: + src: osbs/osbs.conf + dest: /etc/osbs.conf +