mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 15:34:01 -07:00
modules: fix examples to use FQCN for builtin modules (#648)
* modules: fix examples to use FQCN for builtin modules * fix * fix * fix * fix * fix * fix * fix
This commit is contained in:
parent
c034e8c04f
commit
c055340ecb
126 changed files with 290 additions and 286 deletions
|
@ -25,7 +25,7 @@ EXAMPLES = r'''
|
|||
community.general.listen_ports_facts:
|
||||
|
||||
- name: TCP whitelist violation
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: TCP port {{ item.port }} by pid {{ item.pid }} violates the whitelist
|
||||
vars:
|
||||
tcp_listen_violations: "{{ ansible_facts.tcp_listen | selectattr('port', 'in', tcp_whitelist) | list }}"
|
||||
|
@ -35,15 +35,15 @@ EXAMPLES = r'''
|
|||
loop: "{{ tcp_listen_violations }}"
|
||||
|
||||
- name: List TCP ports
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ ansible_facts.tcp_listen | map(attribute='port') | sort | list }}"
|
||||
|
||||
- name: List UDP ports
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ ansible_facts.udp_listen | map(attribute='port') | sort | list }}"
|
||||
|
||||
- name: List all ports
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ (ansible_facts.tcp_listen + ansible_facts.udp_listen) | map(attribute='port') | unique | sort | list }}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -92,11 +92,11 @@ EXAMPLES = '''
|
|||
register: result
|
||||
|
||||
- name: Fail if service not loaded
|
||||
fail: msg="The {{ result.name }} service is not loaded"
|
||||
ansible.builtin.fail: msg="The {{ result.name }} service is not loaded"
|
||||
when: not result.status
|
||||
|
||||
- name: Fail if service is running
|
||||
fail: msg="The {{ result.name }} service is running"
|
||||
ansible.builtin.fail: msg="The {{ result.name }} service is running"
|
||||
when: result.status and result.status['DaemontoolsEncoreState'] == "running"
|
||||
'''
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ EXAMPLES = '''
|
|||
register: pids_of_python
|
||||
|
||||
- name: Printing the process IDs obtained
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "PIDS of python:{{pids_of_python.pids|join(',')}}"
|
||||
'''
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ EXAMPLES = r'''
|
|||
state: present
|
||||
|
||||
- name: Apply new SELinux file context to filesystem
|
||||
command: restorecon -irv /srv/git_repos
|
||||
ansible.builtin.command: restorecon -irv /srv/git_repos
|
||||
'''
|
||||
|
||||
RETURN = r'''
|
||||
|
|
|
@ -53,7 +53,7 @@ EXAMPLES = '''
|
|||
register: syspatch
|
||||
|
||||
- name: Reboot if patch requires it
|
||||
reboot:
|
||||
ansible.builtin.reboot:
|
||||
when: syspatch.reboot_needed
|
||||
'''
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue