]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
pass the list of packages to package management modules
authorRishabh Dave <ridave@redhat.com>
Thu, 8 Nov 2018 09:26:58 +0000 (04:26 -0500)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Fri, 9 Nov 2018 12:59:08 +0000 (12:59 +0000)
Instead of looping over a list of packages or repeating the task
separately for different packages, pass the list of packages to the
task performing package management.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
infrastructure-playbooks/purge-docker-cluster.yml
roles/ceph-docker-common/tasks/pre_requisites/debian_prerequisites.yml
roles/ceph-docker-common/tasks/pre_requisites/prerequisites.yml
roles/ceph-nfs/tasks/pre_requisite_non_container_debian.yml
roles/ceph-nfs/tasks/pre_requisite_non_container_red_hat.yml

index b9add86f3050baec0b813c53027408279dbfe81a..7aebbf1d096c88f0b2331dcc009c45462976a105 100644 (file)
 
   - name: red hat based systems tasks
     block:
-      - name: remove epel-release on redhat
-        yum:
-          name: epel-release
-          state: absent
-
       - name: yum related tasks on red hat
         block:
-          - name: remove pip on redhat
-            yum:
-              name: python-pip
-              state: absent
-
-          - name: remove docker-engine on redhat
-            yum:
-              name: docker-engine
-              state: absent
-
-          # for CentOS
-          - name: remove docker on redhat
+          - name: remove packages on redhat
             yum:
-              name: docker
+              name: ['epel-release', 'python-pip', 'docker-engine', 'docker']
               state: absent
 
           - name: remove package dependencies on redhat
index a95b413254eeee9446d4d895565afb6bb0db9dba..3958a51887db7e032de0149f632407c9f63e463f 100644 (file)
@@ -1,14 +1,9 @@
 ---
 - name: allow apt to use a repository over https (debian)
   package:
-    name: "{{ item }}"
+    name: ['apt-transport-https', 'ca-certificates', 'curl', 'software-properties-common']
     state: present
     update_cache: yes
-  with_items:
-    - apt-transport-https
-    - ca-certificates
-    - curl
-    - software-properties-common
 
 - name: add docker's gpg key
   apt_key:
index d28f7f0b545b966d1616910afa5cd5263e88a0cb..e3d5f4a10c750e1ad443558825ff551ef4d2f691 100644 (file)
   block:
     - name: install docker on ubuntu
       package:
-        name: docker.io
+        name: ['docker.io', 'python-docker']
         state: present
         update_cache: yes
       tags:
         with_pkg
-    - name: install python-docker on ubuntu
-      package:
-        name: python-docker
-        state: present
-      tags:
-        with_pkg
   when:
     - ansible_distribution == 'Ubuntu'
 
   block:
     - name: install python-docker-py on red hat / centos
       package:
-        name: python-docker-py
-        state: present
-      tags:
-        with_pkg
-    - name: install docker on red hat / centos
-      package:
-        name: docker
+        name: ['docker', 'python-docker-py']
         state: present
       tags:
         with_pkg
index b1c3d9a0aec3a68e0852844647cf4fd95e2ee3e2..21324116d695f45e5c9f0f9ec39654dd2444f927 100644 (file)
             update_cache: yes
         - name: install nfs rgw/cephfs gateway - debian
           apt:
-            name: "{{ item.name }}"
+            name: ['nfs-ganesha-rgw', 'radosgw']
             allow_unauthenticated: yes
-          with_items:
-            - { name: 'nfs-ganesha-rgw', install: "{{ nfs_obj_gw }}" }
-            - { name: 'radosgw', install: "{{ nfs_obj_gw }}" }
-            - { name: 'nfs-ganesha-ceph', install: "{{ nfs_file_gw }}" }
-          when:
-            - item.install | bool
+          when: nfs_obj_gw
+        - name: install nfs rgw/cephfs gateway - debian
+          apt:
+            name: nfs-ganesha-ceph
+            allow_unauthenticated: yes
+          when: nfs_file_gw
       when:
         - (ceph_origin == 'repository' or ceph_origin == 'distro')
         - ceph_repository != 'rhcs'
index bc4bd91696f47538de3df7a1f11a992cee9223d8..d7ebcc3892b67dd4e7de943fb145f3a69a04180b 100644 (file)
 
     - name: install redhat nfs-ganesha-rgw and ceph-radosgw packages
       package:
-        name: "{{ item }}"
+        name: ['nfs-ganesha-rgw', 'ceph-radosgw']
         state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
-      with_items:
-        - nfs-ganesha-rgw
-        - ceph-radosgw
       when:
         - nfs_obj_gw