About Specific YAML Syntax
YAML format has some syntax which has no analogies in JSON.
>
means that the lines after will be combined into a single line by replacing line breaks to spaces.|
means that the lines after should preserve the original line breaks.
Here are some example Ansible commands using that syntax:
- name: Backup and optimize database
shell: >
pg_dump mydatabase > /backup/db_backup_$(date +%Y%m%d).sql &&
psql mydatabase -c "VACUUM FULL ANALYZE" &&
gzip /backup/db_backup_$(date +%Y%m%d).sql
- name: Create a script
copy:
content: |
#!/bin/bash
echo "First line"
echo "Second line"
exit 0
dest: /path/to/script.sh
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django App for You
Django GDPR Cookie Consent app
For Django websites that use cookies.
Django App for You