diff --git a/roles/ceph-agent/tasks/pre_requisite.yml b/roles/ceph-agent/tasks/pre_requisite.yml index 6d517c055..1171be8d4 100644 --- a/roles/ceph-agent/tasks/pre_requisite.yml +++ b/roles/ceph-agent/tasks/pre_requisite.yml @@ -6,21 +6,12 @@ always_run: true when: ansible_os_family == 'RedHat' -- name: install dependencies - apt: - pkg: rhscon-agent - state: present - when: ansible_os_family == 'Debian' - tags: - - package-install - - name: install dependencies # XXX Determine what RH repository this will belong to so that it can be # properly checked and errored if the repository is not enabled. - yum: + package: name: rhscon-agent state: present - when: ansible_os_family == 'RedHat' tags: - package-install diff --git a/roles/ceph-common/tasks/installs/debian_ceph_repository.yml b/roles/ceph-common/tasks/installs/debian_ceph_repository.yml index b0fc2e5e0..f9cbb5edf 100644 --- a/roles/ceph-common/tasks/installs/debian_ceph_repository.yml +++ b/roles/ceph-common/tasks/installs/debian_ceph_repository.yml @@ -26,8 +26,8 @@ when: ceph_dev - name: add ubuntu cloud archive key package - apt: - pkg: ubuntu-cloud-keyring + package: + name: ubuntu-cloud-keyring when: ceph_stable_uca - name: add ubuntu cloud archive repository diff --git a/roles/ceph-common/tasks/installs/install_on_redhat.yml b/roles/ceph-common/tasks/installs/install_on_redhat.yml index bb16932ad..3769eaffa 100644 --- a/roles/ceph-common/tasks/installs/install_on_redhat.yml +++ b/roles/ceph-common/tasks/installs/install_on_redhat.yml @@ -1,39 +1,17 @@ --- -- name: install redhat dependencies via yum - yum: +- name: install redhat dependencies + package: name: "{{ item }}" state: present with_items: "{{ redhat_package_dependencies }}" - when: - - ansible_distribution == "RedHat" - - ansible_pkg_mgr == "yum" + when: ansible_distribution == "RedHat" -- name: install redhat dependencies via dnf - dnf: - name: "{{ item }}" - state: present - with_items: "{{ redhat_package_dependencies }}" - when: - - ansible_distribution == "RedHat" - - ansible_pkg_mgr == "dnf" - -- name: install centos dependencies via yum - yum: +- name: install centos dependencies + package: name: "{{ item }}" state: present with_items: "{{ centos_package_dependencies }}" - when: - - ansible_distribution == "CentOS" - - ansible_pkg_mgr == "yum" - -- name: install centos dependencies via dnf - dnf: - name: "{{ item }}" - state: present - with_items: "{{ centos_package_dependencies }}" - when: - - ansible_distribution == "CentOS" - - ansible_pkg_mgr == "dnf" + when: ansible_distribution == "CentOS" - name: configure ceph yum repository include: redhat_ceph_repository.yml @@ -99,184 +77,82 @@ when: - ceph_origin == 'local' -- name: install distro or red hat storage ceph mon via yum - yum: +- name: install distro or red hat storage ceph mon + package: name: "ceph-mon" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - mon_group_name in group_names - - ansible_pkg_mgr == "yum" - ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis or ceph_origin == "distro" or ceph_custom -- name: install distro or red hat storage ceph mon via dnf - dnf: - name: "ceph-mon" - state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" - when: - - mon_group_name in group_names - - ansible_pkg_mgr == "dnf" - - ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis - or ceph_origin == "distro" - or ceph_custom - -- name: install distro or red hat storage ceph osd via yum - yum: +- name: install distro or red hat storage ceph osd + package: name: "ceph-osd" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - osd_group_name in group_names - - ansible_pkg_mgr == "yum" - ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis or ceph_origin == "distro" or ceph_custom -- name: install distro or red hat storage ceph osd via dnf - dnf: - name: "ceph-osd" - state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" - when: - - osd_group_name in group_names - - ansible_pkg_mgr == "dnf" - - ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis - or ceph_origin == "distro" - or ceph_custom - -- name: install distro or red hat storage ceph mds via yum - yum: +- name: install distro or red hat storage ceph mds + package: name: "ceph-mds" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - mds_group_name in group_names - - ansible_pkg_mgr == "yum" - ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis or ceph_origin == "distro" or ceph_custom -- name: install distro or red hat storage ceph mds via dnf - dnf: - name: "ceph-mds" - state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" - when: - - mds_group_name in group_names - - ansible_pkg_mgr == "dnf" - - ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis - or ceph_origin == "distro" - or ceph_custom - -- name: install distro or red hat storage ceph-fuse via yum - yum: +- name: install distro or red hat storage ceph-fuse + package: name: "ceph-fuse" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - client_group_name in group_names - - ansible_pkg_mgr == "yum" - ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis or ceph_origin == "distro" or ceph_dev or ceph_custom -- name: install distro or red hat storage ceph-fuse via dnf - dnf: - name: "ceph-fuse" - state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" - when: - - client_group_name in group_names - - ansible_pkg_mgr == "dnf" - - ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis - or ceph_origin == "distro" - or ceph_dev - or ceph_custom - -- name: install distro or red hat storage ceph base via yum - yum: +- name: install distro or red hat storage ceph base + package: name: "ceph-base" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - client_group_name in group_names - - ansible_pkg_mgr == "yum" - - ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis - or ceph_origin == "distro" - or ceph_custom - -- name: install distro or red hat storage ceph base via dnf - dnf: - name: "ceph-base" - state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" - when: - - client_group_name in group_names - - ansible_pkg_mgr == "dnf" - ceph_release_num.{{ ceph_release }} > ceph_release_num.infernalis or ceph_origin == "distro" or ceph_custom - name: install ceph-test - yum: + package: name: ceph-test state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" - when: - - ceph_test - - ansible_pkg_mgr == "yum" - -- name: install ceph-test - dnf: - name: ceph-test - state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" - when: - - ceph_test - - ansible_pkg_mgr == "dnf" + when: ceph_test - name: install rados gateway - yum: + package: name: ceph-radosgw state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" - when: - - rgw_group_name in group_names - - ansible_pkg_mgr == "yum" - -- name: install rados gateway - dnf: - name: ceph-radosgw - state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" - when: - - rgw_group_name in group_names - - ansible_pkg_mgr == "dnf" + when: rgw_group_name in group_names - name: install nfs ceph gateway - yum: + package: name: nfs-ganesha-ceph when: - nfs_group_name in group_names - - ansible_pkg_mgr == "yum" - - nfs_file_gw - -- name: install nfs ceph gateway - dnf: - name: nfs-ganesha-ceph - when: - - nfs_group_name in group_names - - ansible_pkg_mgr == "dnf" - nfs_file_gw - name: install nfs rgw gateway - yum: + package: name: "{{ item }}" with_items: - nfs-ganesha-rgw - ceph-radosgw when: - nfs_group_name in group_names - - ansible_pkg_mgr == "yum" - - nfs_obj_gw - -- name: install nfs rgw gateway - dnf: - name: "{{ item }}" - with_items: - - nfs-ganesha-rgw - - ceph-radosgw - when: - - nfs_group_name in group_names - - ansible_pkg_mgr == "dnf" - nfs_obj_gw diff --git a/roles/ceph-common/tasks/installs/install_rh_storage_on_redhat.yml b/roles/ceph-common/tasks/installs/install_rh_storage_on_redhat.yml index 97f392322..dd45243ab 100644 --- a/roles/ceph-common/tasks/installs/install_rh_storage_on_redhat.yml +++ b/roles/ceph-common/tasks/installs/install_rh_storage_on_redhat.yml @@ -17,57 +17,55 @@ - ceph_rhcs_iso_install - name: install dependencies - yum: + package: name: "{{ item }}" state: present with_items: "{{ redhat_package_dependencies }}" - when: - - ansible_pkg_mgr == "yum" - name: install red hat storage ceph mon - yum: + package: name: "ceph-mon" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - mon_group_name in group_names - name: install red hat storage ceph osd - yum: + package: name: "ceph-osd" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - osd_group_name in group_names - name: install red hat storage ceph mds - yum: + package: name: "ceph-mds" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - mds_group_name in group_names - name: install red hat storage ceph-common - yum: + package: name: "ceph-common" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - client_group_name in group_names - name: install ceph-test - yum: + package: name: ceph-test state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - ceph_test - name: install rados gateway - yum: + package: name: ceph-radosgw state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - rgw_group_name in group_names - name: install NFS gateway - yum: + package: name: nfs-ganesha-ceph state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: diff --git a/roles/ceph-common/tasks/installs/redhat_ceph_repository.yml b/roles/ceph-common/tasks/installs/redhat_ceph_repository.yml index 39080e675..4523ca0a7 100644 --- a/roles/ceph-common/tasks/installs/redhat_ceph_repository.yml +++ b/roles/ceph-common/tasks/installs/redhat_ceph_repository.yml @@ -12,36 +12,18 @@ when: ceph_dev - name: add ceph stable repository - yum: + package: name: http://download.ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm + state: present changed_when: false - when: - - ceph_stable - - ansible_pkg_mgr == "yum" - -- name: add ceph stable repository - dnf: - name: http://download.ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm - changed_when: false - when: - - ceph_stable - - ansible_pkg_mgr == "dnf" + when: ceph_stable - name: add ceph development repository - yum: + package: name: http://gitbuilder.ceph.com/ceph-rpm-{{ ceph_dev_redhat_distro }}-x86_64-basic/ref/{{ ceph_dev_branch }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro }}.noarch.rpm + state: present changed_when: false - when: - - ceph_dev - - ansible_pkg_mgr == "yum" - -- name: add ceph development repository - dnf: - name: http://gitbuilder.ceph.com/ceph-rpm-{{ ceph_dev_redhat_distro }}-x86_64-basic/ref/{{ ceph_dev_branch }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro }}.noarch.rpm - changed_when: false - when: - - ceph_dev - - ansible_pkg_mgr == "dnf" + when: ceph_dev - name: add custom repo get_url: diff --git a/roles/ceph-mds/tasks/docker/pre_requisite.yml b/roles/ceph-mds/tasks/docker/pre_requisite.yml index a3ef113f3..24924e357 100644 --- a/roles/ceph-mds/tasks/docker/pre_requisite.yml +++ b/roles/ceph-mds/tasks/docker/pre_requisite.yml @@ -134,34 +134,11 @@ with_pkg when: ansible_version['full'] | version_compare('2.1.0.0', '>=') -- name: install ntp on redhat using yum - yum: +- name: install ntp + package: name: ntp state: present when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'yum' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on redhat using dnf - dnf: - name: ntp - state: present - when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'dnf' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on debian - apt: - name: ntp - state: present - when: - - ansible_os_family == 'Debian' - ntp_service_enabled tags: with_pkg diff --git a/roles/ceph-mon/tasks/calamari.yml b/roles/ceph-mon/tasks/calamari.yml index 5b0c34119..30cb08015 100644 --- a/roles/ceph-mon/tasks/calamari.yml +++ b/roles/ceph-mon/tasks/calamari.yml @@ -1,17 +1,8 @@ --- - name: install calamari server - apt: - pkg: calamari-server + package: + name: calamari-server state: present - when: ansible_os_family == 'Debian' - tags: - - package-install - -- name: install calamari server - yum: - pkg: calamari-server - state: present - when: ansible_os_family == 'RedHat' tags: - package-install diff --git a/roles/ceph-mon/tasks/docker/pre_requisite.yml b/roles/ceph-mon/tasks/docker/pre_requisite.yml index ec44581a3..d41fe7892 100644 --- a/roles/ceph-mon/tasks/docker/pre_requisite.yml +++ b/roles/ceph-mon/tasks/docker/pre_requisite.yml @@ -138,34 +138,11 @@ with_pkg when: ansible_version['full'] | version_compare('2.1.0.0', '>=') -- name: install ntp on redhat using yum - yum: +- name: install ntp + package: name: ntp state: present when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'yum' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on redhat using dnf - dnf: - name: ntp - state: present - when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'dnf' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on debian - apt: - name: ntp - state: present - when: - - ansible_os_family == 'Debian' - ntp_service_enabled tags: with_pkg diff --git a/roles/ceph-nfs/tasks/docker/pre_requisite.yml b/roles/ceph-nfs/tasks/docker/pre_requisite.yml index 27142aa46..8b24c58ac 100644 --- a/roles/ceph-nfs/tasks/docker/pre_requisite.yml +++ b/roles/ceph-nfs/tasks/docker/pre_requisite.yml @@ -107,34 +107,11 @@ tags: with_pkg -- name: install ntp on redhat using yum - yum: +- name: install ntp + package: name: ntp state: present when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'yum' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on redhat using dnf - dnf: - name: ntp - state: present - when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'dnf' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on debian - apt: - name: ntp - state: present - when: - - ansible_os_family == 'Debian' - ntp_service_enabled tags: with_pkg diff --git a/roles/ceph-osd/tasks/docker/pre_requisite.yml b/roles/ceph-osd/tasks/docker/pre_requisite.yml index ab7e21057..83dc90b88 100644 --- a/roles/ceph-osd/tasks/docker/pre_requisite.yml +++ b/roles/ceph-osd/tasks/docker/pre_requisite.yml @@ -126,34 +126,11 @@ with_pkg when: ansible_version['full'] | version_compare('2.1.0.0', '>=') -- name: install ntp on redhat using yum - yum: +- name: install ntp + package: name: ntp state: present when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'yum' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on redhat using dnf - dnf: - name: ntp - state: present - when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'dnf' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on debian - apt: - name: ntp - state: present - when: - - ansible_os_family == 'Debian' - ntp_service_enabled tags: with_pkg diff --git a/roles/ceph-osd/tasks/pre_requisite.yml b/roles/ceph-osd/tasks/pre_requisite.yml index e42d5d2be..be960b293 100644 --- a/roles/ceph-osd/tasks/pre_requisite.yml +++ b/roles/ceph-osd/tasks/pre_requisite.yml @@ -1,10 +1,4 @@ --- -- name: install debian dependencies - apt: - pkg: parted - state: present - when: ansible_os_family == 'Debian' - - name: enable extras repo for centos ini_file: dest: /etc/yum.repos.d/CentOS-Base.repo @@ -13,21 +7,10 @@ value: 1 when: ansible_distribution == 'CentOS' -- name: install redhat dependencies via yum - yum: +- name: install rependencies + package: name: parted state: present - when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == "yum" - -- name: install redhat rependencies via dnf - dnf: - name: parted - state: present - when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == "dnf" - name: create bootstrap-osd directory file: diff --git a/roles/ceph-rbd-mirror/tasks/docker/pre_requisite.yml b/roles/ceph-rbd-mirror/tasks/docker/pre_requisite.yml index 525140264..edaeb6715 100644 --- a/roles/ceph-rbd-mirror/tasks/docker/pre_requisite.yml +++ b/roles/ceph-rbd-mirror/tasks/docker/pre_requisite.yml @@ -134,34 +134,11 @@ with_pkg when: ansible_version['full'] | version_compare('2.1.0.0', '>=') -- name: install ntp on redhat using yum - yum: +- name: install ntp + package: name: ntp state: present when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'yum' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on redhat using dnf - dnf: - name: ntp - state: present - when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'dnf' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on debian - apt: - name: ntp - state: present - when: - - ansible_os_family == 'Debian' - ntp_service_enabled tags: with_pkg diff --git a/roles/ceph-rbd-mirror/tasks/pre_requisite.yml b/roles/ceph-rbd-mirror/tasks/pre_requisite.yml index 11bc6f7a1..cad880050 100644 --- a/roles/ceph-rbd-mirror/tasks/pre_requisite.yml +++ b/roles/ceph-rbd-mirror/tasks/pre_requisite.yml @@ -1,19 +1,10 @@ --- -- name: install dependencies - apt: - pkg: rbd-mirror - state: present - when: ansible_os_family == 'Debian' - tags: - - package-install - - name: install dependencies # XXX Determine what RH repository this will belong to so that it can be # properly checked and errored if the repository is not enabled. - yum: + package: name: rbd-mirror state: present - when: ansible_os_family == 'RedHat' tags: - package-install diff --git a/roles/ceph-restapi/tasks/docker/pre_requisite.yml b/roles/ceph-restapi/tasks/docker/pre_requisite.yml index d004714ad..c6ebb9e2e 100644 --- a/roles/ceph-restapi/tasks/docker/pre_requisite.yml +++ b/roles/ceph-restapi/tasks/docker/pre_requisite.yml @@ -132,34 +132,11 @@ tags: with_pkg -- name: install ntp on redhat using yum - yum: +- name: install ntp + package: name: ntp state: present when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'yum' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on redhat using dnf - dnf: - name: ntp - state: present - when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'dnf' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on debian - apt: - name: ntp - state: present - when: - - ansible_os_family == 'Debian' - ntp_service_enabled tags: with_pkg diff --git a/roles/ceph-rgw/tasks/docker/pre_requisite.yml b/roles/ceph-rgw/tasks/docker/pre_requisite.yml index d135a7f1d..e66c0f49c 100644 --- a/roles/ceph-rgw/tasks/docker/pre_requisite.yml +++ b/roles/ceph-rgw/tasks/docker/pre_requisite.yml @@ -120,34 +120,11 @@ tags: with_pkg -- name: install ntp on redhat using yum - yum: +- name: install ntp + package: name: ntp state: present when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'yum' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on redhat using dnf - dnf: - name: ntp - state: present - when: - - ansible_os_family == 'RedHat' - - ansible_pkg_mgr == 'dnf' - - ntp_service_enabled - tags: - with_pkg - -- name: install ntp on debian - apt: - name: ntp - state: present - when: - - ansible_os_family == 'Debian' - ntp_service_enabled tags: with_pkg diff --git a/roles/ceph-rgw/tasks/openstack-keystone.yml b/roles/ceph-rgw/tasks/openstack-keystone.yml index 719336758..ece05e842 100644 --- a/roles/ceph-rgw/tasks/openstack-keystone.yml +++ b/roles/ceph-rgw/tasks/openstack-keystone.yml @@ -1,18 +1,12 @@ --- - name: install nss-tools on redhat - yum: + package: name: nss-tools state: present - when: ansible_pkg_mgr == "yum" - -- name: install nss-tools on redhat - dnf: - name: nss-tools - state: present - when: ansible_pkg_mgr == "dnf" + when: ansible_pkg_mgr == "yum" or ansible_pkg_mgr == "dnf" - name: install libnss3-tools on debian - apt: + package: name: libnss3-tools state: present when: ansible_pkg_mgr == 'apt'