| |
@@ -623,12 +623,134 @@
|
| |
koji_builder_user: dockerbuilder
|
| |
osbs_builder_user: builder
|
| |
|
| |
+ handlers:
|
| |
+ - name: Remove the previous buildroot image
|
| |
+ docker_image:
|
| |
+ state: absent
|
| |
+ name: buildroot
|
| |
+
|
| |
+ - name: Build the new buildroot container
|
| |
+ docker_image:
|
| |
+ path: /etc/osbs/buildroot/
|
| |
+ name: buildroot
|
| |
+ nocache: yes
|
| |
+
|
| |
+ - name: restart and reload docker service
|
| |
+ systemd:
|
| |
+ name: docker
|
| |
+ state: restarted
|
| |
+ daemon_reload: yes
|
| |
+
|
| |
+
|
| |
tasks:
|
| |
- name: cron entry to clean up old builds
|
| |
copy:
|
| |
src: "{{files}}/osbs/cleanup-old-osbs-builds"
|
| |
dest: "/etc/cron.d/cleanup-old-osbs-builds"
|
| |
|
| |
+ - name: copy the osbs customization file
|
| |
+ copy:
|
| |
+ src: "{{item}}"
|
| |
+ dest: "/etc/osbs/buildroot/"
|
| |
+ owner: root
|
| |
+ mode: 0600
|
| |
+ with_items:
|
| |
+ - "{{files}}/osbs/worker_customize.json"
|
| |
+ - "{{files}}/osbs/orchestrator_customize.json"
|
| |
+
|
| |
+ - name: Create buildroot container conf directory
|
| |
+ file:
|
| |
+ path: "/etc/osbs/buildroot/"
|
| |
+ state: directory
|
| |
+
|
| |
+ - name: Upload Dockerfile for buildroot container
|
| |
+ template:
|
| |
+ src: "{{ files }}/osbs/buildroot-Dockerfile-{{env}}.j2"
|
| |
+ dest: "/etc/osbs/buildroot/Dockerfile"
|
| |
+ mode: 0400
|
| |
+ notify:
|
| |
+ - Remove the previous buildroot image
|
| |
+ - Build the new buildroot container
|
| |
+
|
| |
+ - name: Upload krb5.conf for buildroot container
|
| |
+ template:
|
| |
+ src: "{{ roles_path }}/base/templates/krb5.conf.j2"
|
| |
+ dest: "/etc/osbs/buildroot/krb5.conf"
|
| |
+ mode: 0644
|
| |
+ notify:
|
| |
+ - Remove the previous buildroot image
|
| |
+ - Build the new buildroot container
|
| |
+
|
| |
+ - name: Upload internal CA for buildroot
|
| |
+ copy:
|
| |
+ src: "{{private}}/files/osbs/{{env}}/osbs-internal.pem"
|
| |
+ dest: "/etc/osbs/buildroot/ca.crt"
|
| |
+ mode: 0400
|
| |
+ notify:
|
| |
+ - Remove the previous buildroot image
|
| |
+ - Build the new buildroot container
|
| |
+
|
| |
+ - name: stat infra repofile
|
| |
+ stat:
|
| |
+ path: "/etc/yum.repos.d/infra-tags.repo"
|
| |
+ register: infra_repo_stat
|
| |
+
|
| |
+ - name: stat /etc/osbs/buildroot/ infra repofile
|
| |
+ stat:
|
| |
+ path: "/etc/osbs/buildroot/infra-tags.repo"
|
| |
+ register: etcosbs_infra_repo_stat
|
| |
+
|
| |
+ - name: remove old /etc/osbs/buildroot/ infra repofile
|
| |
+ file:
|
| |
+ path: "/etc/osbs/buildroot/infra-tags.repo"
|
| |
+ state: absent
|
| |
+ when: etcosbs_infra_repo_stat.stat.exists and infra_repo_stat.stat.checksum != etcosbs_infra_repo_stat.stat.checksum
|
| |
+
|
| |
+ - name: Copy repofile for buildroot container (because Docker)
|
| |
+ copy:
|
| |
+ src: "/etc/yum.repos.d/infra-tags.repo"
|
| |
+ dest: "/etc/osbs/buildroot/infra-tags.repo"
|
| |
+ remote_src: true
|
| |
+ notify:
|
| |
+ - Remove the previous buildroot image
|
| |
+ - Build the new buildroot container
|
| |
+
|
| |
+ when: etcosbs_infra_repo_stat.stat.exists == false
|
| |
+
|
| |
+ - name: stat /etc/ keytab
|
| |
+ stat:
|
| |
+ path: "/etc/krb5.osbs_{{osbs_url}}.keytab"
|
| |
+ register: etc_kt_stat
|
| |
+
|
| |
+ - name: stat /etc/osbs/buildroot/ keytab
|
| |
+ stat:
|
| |
+ path: "/etc/osbs/buildroot/krb5.osbs_{{osbs_url}}.keytab"
|
| |
+ register: etcosbs_kt_stat
|
| |
+
|
| |
+ - name: remove old hardlink to /etc/osbs/buildroot/ keytab
|
| |
+ file:
|
| |
+ path: "/etc/osbs/buildroot/krb5.osbs_{{osbs_url}}.keytab"
|
| |
+ state: absent
|
| |
+ when: etcosbs_kt_stat.stat.exists and etc_kt_stat.stat.checksum != etcosbs_kt_stat.stat.checksum
|
| |
+
|
| |
+ - name: Hardlink keytab for buildroot container (because Docker)
|
| |
+ file:
|
| |
+ src: "/etc/krb5.osbs_{{osbs_url}}.keytab"
|
| |
+ dest: "/etc/osbs/buildroot/krb5.osbs_{{osbs_url}}.keytab"
|
| |
+ state: hard
|
| |
+ notify:
|
| |
+ - Remove the previous buildroot image
|
| |
+ - Build the new buildroot container
|
| |
+
|
| |
+ when: etcosbs_kt_stat.stat.exists == false
|
| |
+
|
| |
+ - name: pull fedora required docker images
|
| |
+ command: "docker pull {{source_registry}}/{{item}}"
|
| |
+ with_items: "{{fedora_required_images}}"
|
| |
+ register: docker_pull_fedora
|
| |
+ changed_when: "'Downloaded newer image' in docker_pull_fedora.stdout"
|
| |
+
|
| |
+
|
| |
- name: post-install osbs control tasks
|
| |
hosts: osbs_control
|
| |
tags: osbs-post-install
|
| |