mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 07:05:27 +01:00
lint fixes
This commit is contained in:
parent
e5733c5e49
commit
83c4d2abd1
1 changed files with 6 additions and 5 deletions
|
|
@ -335,19 +335,20 @@
|
|||
|
||||
# Test sysctl: sysctl_file is symlink
|
||||
- name: Create link source
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
# Testing Ansible Sysctl module on symlink.
|
||||
dest: /tmp/ansible_sysctl_test.conf
|
||||
mode: "0644"
|
||||
|
||||
- name: Create symlink to the conf file
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
src: /tmp/ansible_sysctl_test.conf
|
||||
dest: /tmp/ansible_sysctl_test_symlink.conf
|
||||
state: link
|
||||
|
||||
- name: Use sysctl module with symlink sysctl file
|
||||
sysctl:
|
||||
ansible.posix.sysctl:
|
||||
name: 'kernel.randomize_va_space'
|
||||
value: '1'
|
||||
sysctl_file: /tmp/ansible_sysctl_test_symlink.conf
|
||||
|
|
@ -356,12 +357,12 @@
|
|||
reload: false
|
||||
|
||||
- name: Stat sysctl file
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: /tmp/ansible_sysctl_test_symlink.conf
|
||||
register: stat_result
|
||||
|
||||
- name: Ensure the sysctl file remains a symlink
|
||||
assert:
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- stat_result.stat.islnk is defined and stat_result.stat.islnk
|
||||
- stat_result.stat.lnk_source == '/tmp/ansible_sysctl_test.conf'
|
||||
|
|
|
|||
Loading…
Reference in a new issue