mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 15:15:26 +01:00
sysctl: Fixed sysctl to work on symlinks(#111)
This commit is contained in:
parent
a842e5f96a
commit
9064ff7eb2
1 changed files with 0 additions and 33 deletions
|
|
@ -332,36 +332,3 @@
|
||||||
that:
|
that:
|
||||||
- sysctl_invalid_set1 is failed
|
- sysctl_invalid_set1 is failed
|
||||||
- "'vm.mmap_rnd_bits' not in sysctl_invalid_conf_content.stdout"
|
- "'vm.mmap_rnd_bits' not in sysctl_invalid_conf_content.stdout"
|
||||||
|
|
||||||
# Test sysctl: sysctl_file is symlink
|
|
||||||
- name: Create link source
|
|
||||||
copy:
|
|
||||||
content: |
|
|
||||||
# Testing Ansible Sysctl module on symlink.
|
|
||||||
dest: /tmp/ansible_sysctl_test.conf
|
|
||||||
|
|
||||||
- name: Create symlink to the conf file
|
|
||||||
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:
|
|
||||||
name: 'kernel.randomize_va_space'
|
|
||||||
value: '1'
|
|
||||||
sysctl_file: /tmp/ansible_sysctl_test_symlink.conf
|
|
||||||
state: present
|
|
||||||
sysctl_set: false
|
|
||||||
reload: false
|
|
||||||
|
|
||||||
- name: Stat sysctl file
|
|
||||||
stat:
|
|
||||||
path: /tmp/ansible_sysctl_test_symlink.conf
|
|
||||||
register: stat_result
|
|
||||||
|
|
||||||
- name: Ensure the sysctl file remains a symlink
|
|
||||||
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