--- - name: update apt cache apt: update-cache=yes - name: restart ceph command: service ceph restart when: socket.rc == 0 - name: restart ceph-osd-all on ubuntu shell: service ceph restart ; service ceph-osd-all restart when: socket.rc == 0 and ansible_distribution == 'Ubuntu'