--- # # Used to prepare the VM before cloning # - name: This module only works on CentOS 6 x86 assert: that: - "ansible_userspace_bits == '32'" - "ansible_os_family == 'RedHat'" - name: Delete existing SSH Keys file: path=/etc/ssh/{{ item }} state=absent with_items: - ssh_host_dsa_key - ssh_host_dsa_key.pub - ssh_host_key - ssh_host_key.pub - ssh_host_rsa_key - ssh_host_rsa_key.pub tags: prepare-to-export - name: Stop the SSHD service service: name=sshd state=stopped enabled=yes tags: prepare-to-export - name: Halt the Virtual Machine command: /sbin/halt tags: prepare-to-export