Not sure I like managing resources in /root, but puppetlabs-mysql does the same with ~/.my.cnf.