diff --git a/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos.yml b/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos.yml new file mode 100644 index 00000000..40f097ed --- /dev/null +++ b/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos.yml @@ -0,0 +1,6 @@ +--- +# required for dependencies +- name: Enable GlusterFS repo + yum: + name: centos-release-gluster + state: latest diff --git a/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos8.yml b/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos8.yml new file mode 100644 index 00000000..2004493c --- /dev/null +++ b/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos8.yml @@ -0,0 +1,10 @@ +--- +- name: Process common OS tasks + include_tasks: centos.yml + +# https://github.com/samba-in-kubernetes/sit-environment/issues/102 +- name: Modify repositories to point at CentOS vault + shell: >- + find /etc/yum.repos.d/ -name '*.repo' -exec sed -i \ + -e 's|^mirrorlist=|#mirrorlist=|g' \ + -e 's|^#baseurl=http://mirror.centos.org|baseurl=https://vault.centos.org|g' {} \; diff --git a/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos9.yml b/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos9.yml new file mode 100644 index 00000000..64498162 --- /dev/null +++ b/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos9.yml @@ -0,0 +1,3 @@ +--- +- name: Process common OS tasks + include_tasks: centos.yml diff --git a/playbooks/ansible/roles/sit.glusterfs/tasks/common/main.yml b/playbooks/ansible/roles/sit.glusterfs/tasks/common/main.yml index 33987359..996969b6 100644 --- a/playbooks/ansible/roles/sit.glusterfs/tasks/common/main.yml +++ b/playbooks/ansible/roles/sit.glusterfs/tasks/common/main.yml @@ -12,8 +12,11 @@ - name: Enable GlusterFS nightly rpms repository command: yum-config-manager --add-repo http://artifacts.ci.centos.org/gluster/nightly/master.repo -# required for dependencies -- name: Enable GlusterFS repo - yum: - name: centos-release-gluster - state: latest +- name: Process OS specific tasks + include_tasks: "{{ include_file }}" + vars: + prefix: "{{ role_path }}/tasks/common/" + with_first_found: + - files: "{{ [prefix] | product(config.os[site.os].includes) | map('join') | list }}" + loop_control: + loop_var: include_file diff --git a/playbooks/roles/hosts.update/tasks/redhat.yml b/playbooks/roles/hosts.update/tasks/centos.yml similarity index 100% rename from playbooks/roles/hosts.update/tasks/redhat.yml rename to playbooks/roles/hosts.update/tasks/centos.yml diff --git a/playbooks/roles/hosts.update/tasks/centos8.yml b/playbooks/roles/hosts.update/tasks/centos8.yml new file mode 100644 index 00000000..358c5333 --- /dev/null +++ b/playbooks/roles/hosts.update/tasks/centos8.yml @@ -0,0 +1,10 @@ +--- +# https://github.com/samba-in-kubernetes/sit-environment/issues/102 +- name: Modify repositories to point at CentOS vault + shell: >- + find /etc/yum.repos.d/ -name '*.repo' -exec sed -i \ + -e 's|^mirrorlist=|#mirrorlist=|g' \ + -e 's|^#baseurl=http://mirror.centos.org|baseurl=https://vault.centos.org|g' {} \; + +- name: Process common OS tasks + include_tasks: centos.yml diff --git a/playbooks/roles/hosts.update/tasks/centos9.yml b/playbooks/roles/hosts.update/tasks/centos9.yml new file mode 100644 index 00000000..64498162 --- /dev/null +++ b/playbooks/roles/hosts.update/tasks/centos9.yml @@ -0,0 +1,3 @@ +--- +- name: Process common OS tasks + include_tasks: centos.yml