From 3787c9b7adbe5090853ef914652a717996822bce Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Tue, 16 Apr 2019 09:58:52 +0200 Subject: [PATCH] defaults: refact package dependencies installation. Because 5c98e361df5241fbfa5bd0a2ae1317219b7e1244 could be seen as a non backward compatible change this commit reverts it and bring back package dependencies installation support. Let's just modify the default value instead. Signed-off-by: Guillaume Abrioux (cherry picked from commit edfa4310d3f5c2744747643d25f16136005b5259) --- group_vars/all.yml.sample | 4 ++++ group_vars/rhcs.yml.sample | 4 ++++ roles/ceph-common/tasks/installs/install_on_debian.yml | 9 +++++++++ .../tasks/installs/install_redhat_packages.yml | 9 +++++++++ roles/ceph-defaults/defaults/main.yml | 4 ++++ 5 files changed, 30 insertions(+) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 84fa6754e..5b7258cc3 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -76,10 +76,14 @@ dummy: ############ # PACKAGES # ############ +#debian_package_dependencies: [] + #centos_package_dependencies: # - epel-release # - libselinux-python +#redhat_package_dependencies: [] + #suse_package_dependencies: # - python-xml diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index d001247b6..ff62ab1ba 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -76,10 +76,14 @@ fetch_directory: ~/ceph-ansible-keys ############ # PACKAGES # ############ +#debian_package_dependencies: [] + #centos_package_dependencies: # - epel-release # - libselinux-python +#redhat_package_dependencies: [] + #suse_package_dependencies: # - python-xml diff --git a/roles/ceph-common/tasks/installs/install_on_debian.yml b/roles/ceph-common/tasks/installs/install_on_debian.yml index d8b66b2fa..9a3978f00 100644 --- a/roles/ceph-common/tasks/installs/install_on_debian.yml +++ b/roles/ceph-common/tasks/installs/install_on_debian.yml @@ -11,6 +11,15 @@ register: result until: result is succeeded +- name: install dependencies + apt: + name: "{{ debian_package_dependencies }}" + state: present + update_cache: yes + cache_valid_time: 3600 + register: result + until: result is succeeded + - name: include install_debian_packages.yml include_tasks: install_debian_packages.yml when: diff --git a/roles/ceph-common/tasks/installs/install_redhat_packages.yml b/roles/ceph-common/tasks/installs/install_redhat_packages.yml index cd34b860d..d692c1758 100644 --- a/roles/ceph-common/tasks/installs/install_redhat_packages.yml +++ b/roles/ceph-common/tasks/installs/install_redhat_packages.yml @@ -1,4 +1,13 @@ --- +- name: install redhat dependencies + package: + name: "{{ redhat_package_dependencies }}" + state: present + register: result + until: result is succeeded + when: + - ansible_distribution == 'RedHat' + - name: install centos dependencies yum: name: "{{ centos_package_dependencies }}" diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index cb14523e5..7688e0dc4 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -68,10 +68,14 @@ ceph_conf_local: false ############ # PACKAGES # ############ +debian_package_dependencies: [] + centos_package_dependencies: - epel-release - libselinux-python +redhat_package_dependencies: [] + suse_package_dependencies: - python-xml