document example with tasks grouped in a block

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
Laurent Indermühle 2023-10-12 15:15:03 +02:00 committed by GitHub
parent 154d880846
commit 509099e211
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,15 +126,19 @@ EXAMPLES = r'''
exclude_fields: db_size exclude_fields: db_size
return_empty_dbs: true return_empty_dbs: true
- name: Clone users on another server - Step 1 - name: Clone users from one server to another
block:
# Step 1
- name: Fetch information from a source server
delegate_to: server_source delegate_to: server_source
community.mysql.mysql_info: community.mysql.mysql_info:
filter: filter:
- users_privs - users_privs
register: result register: result
# Step 2
# Don't work with sha256_password and cache_sha2_password # Don't work with sha256_password and cache_sha2_password
- name: Clone users on another server - Step 2 - name: Clone users fetched in a previous task to a target server
community.mysql.mysql_user: community.mysql.mysql_user:
name: "{{ item.name }}" name: "{{ item.name }}"
host: "{{ item.host }}" host: "{{ item.host }}"
@ -153,7 +157,6 @@ EXAMPLES = r'''
- item.name != 'root' # In case you don't want to import admin accounts - item.name != 'root' # In case you don't want to import admin accounts
- item.name != 'mariadb.sys' - item.name != 'mariadb.sys'
- item.name != 'mysql' - item.name != 'mysql'
''' '''
RETURN = r''' RETURN = r'''