It is a little noisy when you look at the stdout during playbook execution but the job is done :
Edit: items.name are not necessary but I let them for better reading.
---
# Main tasks for wordpress serveurs
- name: Loop through Wordpress Updates items
command: "{{ item.command }}"
register: var_cmd
with_items:
- { name: Update WP command line tool,
command: wp cli update}
- { name: Update Wordpress Core,
command: "wp core update {{wp_allow}} {{wp_path}}"}
- { name: Update Wordpress Core Data Base,
command: "wp core update-db {{wp_allow}} {{wp_path}}"}
- { name: Update Plugins,
command: "wp plugin update --all {{wp_allow}} {{wp_path}}"}
- { name: Update Themes,
command: "wp theme update --all {{wp_allow}} {{wp_path}}"}
- { name: Update Core Translations,
command: "wp language core update {{wp_allow}} {{wp_path}}"}
- { name: Update Plugins Translations,
command: "wp language plugin update --all {{wp_allow}} {{wp_path}}"}
- { name: Update Themes Translations,
command: "wp language theme update --all {{wp_allow}} {{wp_path}}"}
- name: Debug Wordpress Updates
debug:
msg: "{{ item.stdout_lines }}"
verbosity: 0
with_items: "{{ var_cmd['results'] }}"
# Call to Zabbix tasks
- include: zabbix.yml
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…