refactor(cloudinit): quit using grep
refactor(cloudinit): Use Tempfile