--- - name: install build packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=installed" with_items: - rpm-build - rpmdevtools - name: install build packages yum: name=yum-utils state=installed when: ansible_pkg_mgr == "yum" - name: delete rpmbuild directories file: path={{ install_openshift_source_rpmbuild_dir }}/{{ item }}/ state=absent with_items: - RPMS - SRPMS - BUILD - BUILDROOT - name: create rpmbuild directories file: path={{ install_openshift_source_rpmbuild_dir }}/{{ item }}/ state=directory recurse=yes with_items: - SPECS - SOURCES - name: upload SPEC template: src=openshift.spec.j2 dest={{ install_openshift_source_rpmbuild_dir }}/SPECS/openshift.spec - name: install build dependencies command: yum-builddep -y {{ install_openshift_source_rpmbuild_dir }}/SPECS/openshift.spec when: ansible_pkg_mgr == "yum" - name: install build dependencies command: dnf builddep -y {{ install_openshift_source_rpmbuild_dir }}/SPECS/openshift.spec when: ansible_pkg_mgr == "dnf" - name: download openshift tarball get_url: url: https://github.com/openshift/origin/archive/{{ install_openshift_source_commit }}/{{ install_openshift_source_archive }} dest: "{{ install_openshift_source_rpmbuild_dir }}/SOURCES/{{ install_openshift_source_archive }}" - name: run build command: rpmbuild -bb --clean {{ install_openshift_source_rpmbuild_dir }}/SPECS/openshift.spec - name: find the RPMs command: find {{ install_openshift_source_rpmbuild_dir }}/RPMS/ -type f register: find_rpms - name: install the RPMs shell: yum -y localinstall {{ install_openshift_source_rpmbuild_dir }}/RPMS/x86_64/*openshift*.rpm when: ansible_pkg_mgr == "yum" - name: install the RPMs shell: dnf -y install {{ install_openshift_source_rpmbuild_dir }}/RPMS/x86_64/*openshift*.rpm when: ansible_pkg_mgr == "dnf" - name: link /etc/openshift to /etc/origin file: path=/etc/openshift src=/etc/origin state=link