Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # cat /root/.my.cnf
- [client]
- user=root
- password=verySecretPassword
- ----------
- # stat /root/.my.cnf
- File: ‘/root/.my.cnf’
- Size: 49 Blocks: 8 IO Block: 4096 regular file
- Device: fd01h/64769d Inode: 9017 Links: 1
- Access: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root)
- Access: 2016-08-18 10:45:46.610721444 +0200
- Modify: 2016-08-18 09:38:42.165106840 +0200
- Change: 2016-08-18 10:45:32.478718044 +0200
- Birth: -
- ----------
- # cat /etc/ansible/roles/backup-jobs/tasks/database_backups.yml
- [...]
- - name: Saving MySQL root password to variable
- shell: grep password /root/.my.cnf | cut -d "=" -f 2
- register: mysql_root_password
- no_log: True
- - name: Setting MySQL root password in automysqlbackup configuration file
- replace: dest={{ item }} regexp=PASSWORD replace={{ mysql_root_password.stdout }}
- with_items:
- - '/etc/automysqlbackup/myserver.conf'
- no_log: True
- [...]
- ----------
- # cat /etc/ansible/playbooks/groups/backups.yml
- - hosts: all
- become: yes
- roles:
- - backup-jobs
- [...]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement