From e29bd2c382fc90fd4e3761cfe6328871c5de2c45 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Fri, 17 Feb 2017 13:10:25 -0500 Subject: Disentangle openshift_repos from openshift_facts --- roles/openshift_repos/meta/main.yml | 3 +- roles/openshift_repos/tasks/main.yaml | 79 +++++++++++++++++------------------ 2 files changed, 39 insertions(+), 43 deletions(-) diff --git a/roles/openshift_repos/meta/main.yml b/roles/openshift_repos/meta/main.yml index 0558b822c..cc18c453c 100644 --- a/roles/openshift_repos/meta/main.yml +++ b/roles/openshift_repos/meta/main.yml @@ -11,5 +11,4 @@ galaxy_info: - 7 categories: - cloud -dependencies: -- { role: openshift_facts } +dependencies: [] diff --git a/roles/openshift_repos/tasks/main.yaml b/roles/openshift_repos/tasks/main.yaml index 23dcd0440..ffb760bfe 100644 --- a/roles/openshift_repos/tasks/main.yaml +++ b/roles/openshift_repos/tasks/main.yaml @@ -1,50 +1,47 @@ --- -# TODO: Add flag for enabling EPEL repo, default to false - -# TODO: Add subscription-management config, with parameters -# for username, password, poolid(name), and official repos to -# enable/disable. Might need to make a module that extends the -# subscription management module to take a poolid and enable/disable the -# proper repos correctly. +- name: openshift_repos detect ostree + stat: + path: /run/ostree-booted + register: ostree_booted - assert: that: openshift_deployment_type in known_openshift_deployment_types - when: not openshift.common.is_containerized | bool + msg: "openshift_deployment_type must be one of {{ known_openshift_deployment_types }}" -- name: Ensure libselinux-python is installed - package: name=libselinux-python state=present - when: not openshift.common.is_containerized | bool +- block: + - name: Ensure libselinux-python is installed + package: name=libselinux-python state=present -- name: Create any additional repos that are defined - template: - src: yum_repo.j2 - dest: /etc/yum.repos.d/openshift_additional.repo - when: openshift_additional_repos | length > 0 and not openshift.common.is_containerized | bool - notify: refresh cache + - name: Create any additional repos that are defined + template: + src: yum_repo.j2 + dest: /etc/yum.repos.d/openshift_additional.repo + when: + - openshift_additional_repos | length > 0 + notify: refresh cache -- name: Remove the additional repos if no longer defined - file: - dest: /etc/yum.repos.d/openshift_additional.repo - state: absent - when: openshift_additional_repos | length == 0 and not openshift.common.is_containerized | bool - notify: refresh cache + - name: Remove the additional repos if no longer defined + file: + dest: /etc/yum.repos.d/openshift_additional.repo + state: absent + when: + - openshift_additional_repos | length == 0 + notify: refresh cache -- name: Configure origin gpg keys if needed - copy: - src: origin/gpg_keys/openshift-ansible-CentOS-SIG-PaaS - dest: /etc/pki/rpm-gpg/ - notify: refresh cache - when: ansible_os_family == "RedHat" and ansible_distribution != "Fedora" - and openshift_deployment_type == 'origin' - and not openshift.common.is_containerized | bool - and openshift_enable_origin_repo | default(true) | bool + - name: Configure origin gpg keys if needed + copy: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + with_items: + - src: origin/gpg_keys/openshift-ansible-CentOS-SIG-PaaS + dest: /etc/pki/rpm-gpg/ + - src: origin/repos/openshift-ansible-centos-paas-sig.repo + dest: /etc/yum.repos.d/ + notify: refresh cache + when: + - ansible_os_family == "RedHat" + - ansible_distribution != "Fedora" + - openshift_deployment_type == 'origin' + - openshift_enable_origin_repo | default(true) | bool -- name: Configure origin yum repositories RHEL/CentOS - copy: - src: origin/repos/openshift-ansible-centos-paas-sig.repo - dest: /etc/yum.repos.d/ - notify: refresh cache - when: ansible_os_family == "RedHat" and ansible_distribution != "Fedora" - and openshift_deployment_type == 'origin' - and not openshift.common.is_containerized | bool - and openshift_enable_origin_repo | default(true) | bool + when: not ostree_booted.stat.exists -- cgit v1.2.3 From 7a16f20b936546f47df87662c78f7fe12e75fe85 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Fri, 17 Feb 2017 15:22:40 -0500 Subject: Add centos paas sig common --- .../files/origin/repos/openshift-ansible-centos-paas-sig.repo | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/openshift_repos/files/origin/repos/openshift-ansible-centos-paas-sig.repo b/roles/openshift_repos/files/origin/repos/openshift-ansible-centos-paas-sig.repo index 124bff09d..1af0bd023 100644 --- a/roles/openshift_repos/files/origin/repos/openshift-ansible-centos-paas-sig.repo +++ b/roles/openshift_repos/files/origin/repos/openshift-ansible-centos-paas-sig.repo @@ -5,6 +5,13 @@ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/openshift-ansible-CentOS-SIG-PaaS +[centos-openshift-origin-common] +name=CentOS OpenShift Origin Common +baseurl=http://mirror.centos.org/centos/7/paas/x86_64/openshift-origin/common/ +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/openshift-ansible-CentOS-SIG-PaaS + [centos-openshift-origin-testing] name=CentOS OpenShift Origin Testing baseurl=http://buildlogs.centos.org/centos/7/paas/x86_64/openshift-origin/ -- cgit v1.2.3 From ed436f89d3511758e38f75a488794d76dd8915bd Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Fri, 17 Feb 2017 15:23:40 -0500 Subject: add dependency on openshift_repos --- roles/lib_openshift/meta/main.yml | 15 +++++++++++++++ roles/lib_utils/meta/main.yml | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 roles/lib_openshift/meta/main.yml create mode 100644 roles/lib_utils/meta/main.yml diff --git a/roles/lib_openshift/meta/main.yml b/roles/lib_openshift/meta/main.yml new file mode 100644 index 000000000..7c72daa63 --- /dev/null +++ b/roles/lib_openshift/meta/main.yml @@ -0,0 +1,15 @@ +--- +galaxy_info: + author: OpenShift Team + description: OpenShift Repositories + company: Red Hat, Inc. + license: Apache License, Version 2.0 + min_ansible_version: 1.7 + platforms: + - name: EL + versions: + - 7 + categories: + - cloud +dependencies: +- { role: openshift_repos } diff --git a/roles/lib_utils/meta/main.yml b/roles/lib_utils/meta/main.yml new file mode 100644 index 000000000..e06b9a0f1 --- /dev/null +++ b/roles/lib_utils/meta/main.yml @@ -0,0 +1,15 @@ +--- +galaxy_info: + author: TODO + description: OpenShift Repositories + company: Red Hat, Inc. + license: Apache License, Version 2.0 + min_ansible_version: 1.7 + platforms: + - name: EL + versions: + - 7 + categories: + - cloud +dependencies: +- { role: openshift_repos } -- cgit v1.2.3