mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
replace NBSP (non-blocking space) character with a regular SPACE char (#3071)
This commit is contained in:
parent
d54d2fa4a6
commit
20db4fc560
19 changed files with 45 additions and 45 deletions
|
@ -12,7 +12,7 @@
|
|||
|
||||
##############
|
||||
# Test parameters:
|
||||
# link parameter present / absent ('with_link' variable)
|
||||
# link parameter present / absent ('with_link' variable)
|
||||
# with / without alternatives defined in alternatives file ('with_alternatives' variable)
|
||||
# auto / manual ('mode' variable)
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
|||
path: '{{ item }}'
|
||||
state: absent
|
||||
with_items:
|
||||
- '{{ alternatives_dir }}/dummy'
|
||||
- '{{ alternatives_dir }}/dummy'
|
||||
|
||||
- file:
|
||||
path: '/usr/bin/dummy{{ item }}'
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
- template:
|
||||
src: dummy_alternative
|
||||
dest: '{{ alternatives_dir }}/dummy'
|
||||
dest: '{{ alternatives_dir }}/dummy'
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
when: with_alternatives or ansible_os_family != 'RedHat'
|
||||
- file:
|
||||
path: '{{ alternatives_dir }}/dummy'
|
||||
path: '{{ alternatives_dir }}/dummy'
|
||||
state: absent
|
||||
when: not with_alternatives and ansible_os_family == 'RedHat'
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
- name: set alternative (using link parameter)
|
||||
alternatives:
|
||||
name: dummy
|
||||
path: '/usr/bin/dummy{{ item }}'
|
||||
path: '/usr/bin/dummy{{ item }}'
|
||||
link: '/usr/bin/dummy'
|
||||
register: alternative
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
|||
- name: set alternative (without link parameter)
|
||||
alternatives:
|
||||
name: dummy
|
||||
path: '/usr/bin/dummy{{ item }}'
|
||||
path: '/usr/bin/dummy{{ item }}'
|
||||
register: alternative
|
||||
|
||||
- name: check expected command was executed
|
||||
|
@ -40,11 +40,11 @@
|
|||
- 'cmd.stdout == "dummy" ~ item'
|
||||
|
||||
- name: 'check mode (manual: alternatives file existed, it has been updated)'
|
||||
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^manual$"'
|
||||
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^manual$"'
|
||||
when: ansible_os_family != 'RedHat' or with_alternatives or item != 1
|
||||
|
||||
- name: 'check mode (auto: alternatives file didn''t exist, it has been created)'
|
||||
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^auto$"'
|
||||
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^auto$"'
|
||||
when: ansible_os_family == 'RedHat' and not with_alternatives and item == 1
|
||||
|
||||
- name: check that alternative has been updated
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
name: dummy
|
||||
path: '/usr/bin/dummy{{ item }}'
|
||||
link: /usr/bin/dummy
|
||||
priority: '{{ 60 + item|int }}'
|
||||
priority: '{{ 60 + item|int }}'
|
||||
register: alternative
|
||||
|
||||
- name: execute dummy command
|
||||
|
@ -11,13 +11,13 @@
|
|||
register: cmd
|
||||
|
||||
- name: check if link group is in manual mode
|
||||
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^manual$"'
|
||||
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^manual$"'
|
||||
|
||||
- name: check expected command was executed
|
||||
assert:
|
||||
that:
|
||||
- 'alternative is changed'
|
||||
- 'cmd.stdout == "dummy{{ item }}"'
|
||||
- 'cmd.stdout == "dummy{{ item }}"'
|
||||
|
||||
- name: check that alternative has been updated
|
||||
command: "grep -Pzq '/bin/dummy{{ item }}\\n{{ 60 + item|int }}' '{{ alternatives_dir }}/dummy'"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue