- Security Automation with Ansible 2
- Madhu Akula Akash Mahajan
- 108字
- 2021-07-02 22:00:01
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 }}"
推薦閱讀
- 玩轉智能機器人程小奔
- 腦動力:Linux指令速查效率手冊
- Linux Mint System Administrator’s Beginner's Guide
- 空間機器人遙操作系統及控制
- Mastering Salesforce CRM Administration
- 21天學通Java Web開發
- Hybrid Cloud for Architects
- 西門子變頻器技術入門及實踐
- Machine Learning with the Elastic Stack
- LAMP網站開發黃金組合Linux+Apache+MySQL+PHP
- 從零開始學C++
- 在實戰中成長:C++開發之路
- The DevOps 2.1 Toolkit:Docker Swarm
- 生物3D打印:從醫療輔具制造到細胞打印
- 電腦故障排除與維護終極技巧金典