mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 15:15:26 +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
|
# Test sysctl: sysctl_file is symlink
|
||||||
- name: Create link source
|
- name: Create link source
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
content: |
|
content: |
|
||||||
# Testing Ansible Sysctl module on symlink.
|
# Testing Ansible Sysctl module on symlink.
|
||||||
dest: /tmp/ansible_sysctl_test.conf
|
dest: /tmp/ansible_sysctl_test.conf
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
- name: Create symlink to the conf file
|
- name: Create symlink to the conf file
|
||||||
file:
|
ansible.builtin.file:
|
||||||
src: /tmp/ansible_sysctl_test.conf
|
src: /tmp/ansible_sysctl_test.conf
|
||||||
dest: /tmp/ansible_sysctl_test_symlink.conf
|
dest: /tmp/ansible_sysctl_test_symlink.conf
|
||||||
state: link
|
state: link
|
||||||
|
|
||||||
- name: Use sysctl module with symlink sysctl file
|
- name: Use sysctl module with symlink sysctl file
|
||||||
sysctl:
|
ansible.posix.sysctl:
|
||||||
name: 'kernel.randomize_va_space'
|
name: 'kernel.randomize_va_space'
|
||||||
value: '1'
|
value: '1'
|
||||||
sysctl_file: /tmp/ansible_sysctl_test_symlink.conf
|
sysctl_file: /tmp/ansible_sysctl_test_symlink.conf
|
||||||
|
|
@ -356,12 +357,12 @@
|
||||||
reload: false
|
reload: false
|
||||||
|
|
||||||
- name: Stat sysctl file
|
- name: Stat sysctl file
|
||||||
stat:
|
ansible.builtin.stat:
|
||||||
path: /tmp/ansible_sysctl_test_symlink.conf
|
path: /tmp/ansible_sysctl_test_symlink.conf
|
||||||
register: stat_result
|
register: stat_result
|
||||||
|
|
||||||
- name: Ensure the sysctl file remains a symlink
|
- name: Ensure the sysctl file remains a symlink
|
||||||
assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- stat_result.stat.islnk is defined and stat_result.stat.islnk
|
- stat_result.stat.islnk is defined and stat_result.stat.islnk
|
||||||
- stat_result.stat.lnk_source == '/tmp/ansible_sysctl_test.conf'
|
- stat_result.stat.lnk_source == '/tmp/ansible_sysctl_test.conf'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue