mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Add yamllint for plugin docs and fix issues.
This commit is contained in:
@@ -19,7 +19,7 @@ DOCUMENTATION = '''
|
||||
- constructed
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
EXAMPLES = r'''
|
||||
# inventory.config file in YAML format
|
||||
plugin: constructed
|
||||
strict: False
|
||||
|
||||
@@ -28,8 +28,8 @@ DOCUMENTATION = """
|
||||
"""
|
||||
|
||||
EXAMPLES = """
|
||||
- debug
|
||||
msg: {{ lookup('chef_databag', 'name=data_bag_name item=data_bag_item') }}
|
||||
- debug:
|
||||
msg: "{{ lookup('chef_databag', 'name=data_bag_name item=data_bag_item') }}"
|
||||
"""
|
||||
|
||||
RETURN = """
|
||||
|
||||
@@ -31,7 +31,8 @@ EXAMPLES = """
|
||||
debug: msg="{{ lookup('config', 'DEFAULT_BECOME_USER')}}"
|
||||
|
||||
- name: print out role paths
|
||||
debug: msg="These are the configured role paths: {{lookup('config', 'DEFAULT_ROLES_PATH')}}"
|
||||
debug:
|
||||
msg: "These are the configured role paths: {{lookup('config', 'DEFAULT_ROLES_PATH')}}"
|
||||
|
||||
- name: find retry files, skip if missing that key
|
||||
find:
|
||||
|
||||
@@ -43,8 +43,8 @@ DOCUMENTATION = """
|
||||
"""
|
||||
|
||||
EXAMPLES = """
|
||||
- debug
|
||||
msg: {{ lookup('conjur_variable', '/path/to/secret') }}
|
||||
- debug:
|
||||
msg: "{{ lookup('conjur_variable', '/path/to/secret') }}"
|
||||
"""
|
||||
|
||||
RETURN = """
|
||||
|
||||
@@ -19,12 +19,6 @@ DOCUMENTATION = """
|
||||
"""
|
||||
|
||||
EXAMPLES = """
|
||||
tasks:
|
||||
- name: show dictionary
|
||||
debug: msg="{{item.key}}: {{item.value}}"
|
||||
with_dict: {a: 1, b: 2, c: 3}
|
||||
|
||||
# with predefined vars
|
||||
vars:
|
||||
users:
|
||||
alice:
|
||||
@@ -34,10 +28,16 @@ vars:
|
||||
name: Bob Bananarama
|
||||
telephone: 987-654-3210
|
||||
tasks:
|
||||
# with predefined vars
|
||||
- name: Print phone records
|
||||
debug:
|
||||
msg: "User {{ item.key }} is {{ item.value.name }} ({{ item.value.telephone }})"
|
||||
loop: "{{ lookup('dict', users) }}"
|
||||
# with inline dictionary
|
||||
- name: show dictionary
|
||||
debug:
|
||||
msg: "{{item.key}}: {{item.value}}"
|
||||
with_dict: {a: 1, b: 2, c: 3}
|
||||
"""
|
||||
|
||||
RETURN = """
|
||||
|
||||
@@ -40,7 +40,8 @@ EXAMPLES = """
|
||||
- testuser2
|
||||
|
||||
- name: "loop through list from a variable"
|
||||
debug: msg="An item: {{item}}"
|
||||
debug:
|
||||
msg: "An item: {{item}}"
|
||||
with_items: "{{ somelist }}"
|
||||
|
||||
- name: more complex items to add several users
|
||||
|
||||
@@ -27,7 +27,7 @@ EXAMPLES = """
|
||||
with_nested:
|
||||
- [ 'alice', 'bob' ]
|
||||
- [ 'clientdb', 'employeedb', 'providerdb' ]
|
||||
As with the case of 'with_items' above, you can use previously defined variables.:
|
||||
# As with the case of 'with_items' above, you can use previously defined variables.:
|
||||
|
||||
- name: here, 'users' contains the above list of employees
|
||||
mysql_user:
|
||||
|
||||
@@ -69,7 +69,7 @@ EXAMPLES = """
|
||||
|
||||
- name: get a host record
|
||||
set_fact:
|
||||
host: "{{ lookup('nios', 'record:host', filter={'name': 'hostname.ansible.com'}) }}
|
||||
host: "{{ lookup('nios', 'record:host', filter={'name': 'hostname.ansible.com'}) }}"
|
||||
|
||||
- name: get the authoritative zone from a non default dns view
|
||||
set_fact:
|
||||
|
||||
@@ -68,7 +68,7 @@ EXAMPLES = """
|
||||
priv: "{{ client }}_{{ tier }}_{{ role }}.*:ALL"
|
||||
|
||||
- name: create a mysql user with a random password using only ascii letters
|
||||
mysql_user: name={{ client }} password="{{ lookup('password', '/tmp/passwordfile chars=ascii_letters') }}" priv='{{ client }}_{{ tier }}_{{ role }}.*:ALL'
|
||||
mysql_user: name={{ client }} password="{{ lookup('password', '/tmp/passwordfile chars=ascii_letters') }}" priv='{{ client }}_{{ tier }}_{{ role }}.*:ALL'
|
||||
|
||||
- name: create a mysql user with a random password using only digits
|
||||
mysql_user:
|
||||
|
||||
@@ -40,7 +40,7 @@ EXAMPLES = """
|
||||
variablename: hello
|
||||
myvar: notename
|
||||
|
||||
- name: find several related variables:
|
||||
- name: find several related variables
|
||||
debug: msg="{{ lookup('vars', 'ansible_play_hosts', 'ansible_play_batch', 'ansible_play_hosts_all') }}"
|
||||
|
||||
- name: alternate way to find some 'prefixed vars' in loop
|
||||
|
||||
Reference in New Issue
Block a user