Skip to content

Commit

Permalink
ceph-common: export repository configuration to a single task
Browse files Browse the repository at this point in the history
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
  • Loading branch information
clwluvw authored and guits committed Oct 8, 2021
1 parent 0b78faa commit e79bda9
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 36 deletions.
31 changes: 31 additions & 0 deletions roles/ceph-common/tasks/configure_repository.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
- name: config repository for Red Hat based OS
when: ansible_facts['os_family'] == 'RedHat'
block:
- name: include installs/configure_redhat_repository_installation.yml
include_tasks: installs/configure_redhat_repository_installation.yml
when: ceph_origin == 'repository'

- name: include installs/configure_redhat_local_installation.yml
include_tasks: installs/configure_redhat_local_installation.yml
when: ceph_origin == 'local'

- name: config repository for Debian based OS
when: ansible_facts['os_family'] == 'Debian'
block:
- name: include installs/configure_debian_repository_installation.yml
include_tasks: installs/configure_debian_repository_installation.yml
when: ceph_origin == 'repository'

- name: update apt cache if cache_valid_time has expired
apt:
update_cache: yes
cache_valid_time: 3600
register: result
until: result is succeeded

- name: include installs/configure_suse_repository_installation.yml
include_tasks: installs/configure_suse_repository_installation.yml
when:
- ansible_facts['os_family'] == 'Suse'
- ceph_origin == 'repository'
12 changes: 0 additions & 12 deletions roles/ceph-common/tasks/installs/install_on_debian.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
---
- name: include configure_debian_repository_installation.yml
include_tasks: configure_debian_repository_installation.yml
when: ceph_origin == 'repository'

- name: update apt cache if cache_valid_time has expired
apt:
update_cache: yes
cache_valid_time: 3600
register: result
until: result is succeeded

- name: install dependencies
apt:
name: "{{ debian_package_dependencies }}"
Expand Down
12 changes: 0 additions & 12 deletions roles/ceph-common/tasks/installs/install_on_redhat.yml

This file was deleted.

7 changes: 0 additions & 7 deletions roles/ceph-common/tasks/installs/install_on_suse.yml

This file was deleted.

16 changes: 11 additions & 5 deletions roles/ceph-common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
---
- name: include_tasks installs/install_on_redhat.yml
include_tasks: installs/install_on_redhat.yml
when: ansible_facts['os_family'] == 'RedHat'
- name: include configure_repository.yml
include_tasks: configure_repository.yml
tags: package-configure

- name: include installs/install_redhat_packages.yml
include_tasks: installs/install_redhat_packages.yml
when:
- ansible_facts['os_family'] == 'RedHat'
- (ceph_origin == 'repository' or ceph_origin == 'distro')
tags: package-install

- name: include_tasks installs/install_on_suse.yml
include_tasks: installs/install_on_suse.yml
- name: include installs/install_suse_packages.yml
include_tasks: installs/install_suse_packages.yml
when: ansible_facts['os_family'] == 'Suse'
tags: package-install

Expand Down

0 comments on commit e79bda9

Please sign in to comment.