- name: create website backup directory file: path: "{{ backup_website }}" state: directory delegate_to: localhost - name: backup website synchronize: mode: pull src: "/var/www/{{ item }}" dest: "{{ backup_website }}" with_items: "sites" ### Sonerezh database and sound ### - name: backup sonerezh database mysql_db: state: dump name: sonerezh login_user: sonerezh login_password: "{{ db_pwd_sonerezh }}" target: "/var/www/sonerezh-sqlbkp.bak" - name: copy backup database synchronize: mode: pull src: /var/www/sonerezh-sqlbkp.bak dest: "{{ backup_website }}" - name: backup sound data synchronize: mode: pull src: /var/Music dest: "{{ backup_website }}" ### Owncloud ### - name: backup owncloud database mysql_db: state: dump name: owncloud6 login_user: cloudAdmin login_password: "{{ db_pwd_owncloud }}" target: "/var/www/owncloud-sqlbkp.bak" - name: copy backup database synchronize: mode: pull src: /var/www/owncloud-sqlbkp.bak dest: "{{ backup_website }}" - name: backup owncloud data synchronize: mode: pull src: /var/owncloud_data dest: "{{ backup_website }}" ### Apache virtual hosts ### - name: create apache hosts backup directory file: path: "{{ backup_apache }}" state: directory delegate_to: localhost - name: backup apache virtual hosts synchronize: mode: pull src: "/etc/apache2/sites-available/{{ item }}" dest: "{{ backup_apache }}" with_items: "apache_hosts" ### Apache certificates ### - name: create certificates backup directory file: path: "{{ backup_certs }}" state: directory delegate_to: localhost - name: backup certificates synchronize: mode: pull src: "/etc/letsencrypt/live/{{ item }}" dest: "{{ backup_certs }}" with_items: "certificates"