title: How can I move a directory to a newly created partition with ansible?
body: <p>I have an aws image I'm using which didn't allocate enough space for the root partition (4 gigs, really!?)  so I'm trying to make a new partition for /opt and move the existing /opt directory over to the new partition using ansible.</p>
  <p>I've already created the partition and created a filesystem on that partition using ansible.  However, I'm not sure of a clean way to do the copy of the old /opt on the root partition to the new partition.</p>
  <p>I can't mount the new partition as /opt since /opt already exists.  If I was doing things by hand I'd probably mount the new partition to some random name, copy everything over, then remount the partition as opt, but I'm not sure of a clean way to do that in ansible, ideally while being idempotent, or at least only doing the copy if opt is still on the root partition.</p>
  <p>If it matters this is running on a centos 7 vm.</p>