上QQ阅读APP看书,第一时间看更新
Secure automated the WordPress updates
The following code snippet is to run the backups and update WordPress core, themes, and plugins. This can be scheduled via an Ansible Tower job for every day:
- name: running backup using duply
command: /etc/cron.hourly/duply-backup
- name: updating WordPress core
command: wp core update
register: wp_core_update_output
ignore_errors: yes
- name: wp core update output
debug:
msg: "{{ wp_core_update_output.stdout }}"
- name: updating WordPress themes
command: wp theme update --all
register: wp_theme_update_output
ignore_errors: yes
- name: wp themes update output
debug:
msg: "{{ wp_theme_update_output.stdout }}"
- name: updating WordPress plugins
command: wp plugin update --all
register: wp_plugin_update_output
ignore_errors: yes
- name: wp plugins update output
debug:
msg: "{{ wp_plugin_update_output.stdout }}"