Skip to content

Commit 0a97519

Browse files
committed
playbooks: all: add changed_when
Fix Ansible lint errors. Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
1 parent 5db88b8 commit 0a97519

37 files changed

Lines changed: 82 additions & 0 deletions

File tree

playbooks/roles/blktests/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
- name: Get used target kernel version
176176
tags: ["blktests", "copy_results", "augment_expunge_list"]
177177
ansible.builtin.command: "uname -r"
178+
changed_when: false
178179
register: uname_cmd
179180

180181
- name: Store last kernel variable
@@ -193,6 +194,7 @@
193194

194195
- name: Document used target kernel version
195196
ansible.builtin.shell: echo {{ last_kernel }} > {{ blktests_results_target }}/last-kernel.txt
197+
changed_when: false
196198
delegate_to: localhost
197199
tags: ["blktests", "copy_results", "augment_expunge_list"]
198200
run_once: true
@@ -238,6 +240,7 @@
238240
become_flags: "su - -c"
239241
become_method: ansible.builtin.sudo
240242
ansible.builtin.command: "test -e {{ verify_dev_list }}"
243+
changed_when: false
241244
when:
242245
- kdevops_run_blktests|bool
243246
- blktests_test_devs|length != 0

playbooks/roles/bootlinux/tasks/build/9p.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888

8989
- name: Apply message patch set if requested on the control node
9090
ansible.builtin.shell: b4 am -o - {{target_linux_apply_patch_message_id}} | git am
91+
changed_when: false
9192
args:
9293
chdir: "{{ bootlinux_9p_host_path }}"
9394
when:
@@ -107,6 +108,7 @@
107108

108109
- name: Set kernel localversion if requested on the control node
109110
ansible.builtin.shell: "echo {{ active_linux_localversion | default(target_linux_localversion) }} > {{ bootlinux_9p_host_path }}/localversion"
111+
changed_when: false
110112
when:
111113
- (active_linux_localversion is defined and active_linux_localversion != "") or (target_linux_localversion is defined and target_linux_localversion != "")
112114
run_once: true

playbooks/roles/bootlinux/tasks/build/targets.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161

6262
- name: Apply message patch set if requested on the target nodes
6363
ansible.builtin.shell: b4 am -o - {{target_linux_apply_patch_message_id}} | git am
64+
changed_when: false
6465
args:
6566
chdir: "{{ target_linux_dir_path }}"
6667
when:
@@ -78,6 +79,7 @@
7879

7980
- name: Set kernel localversion if requested on the target nodes
8081
ansible.builtin.shell: "echo {{ target_linux_localversion }} > {{ target_linux_dir_path }}/localversion"
82+
changed_when: false
8183
when:
8284
- target_linux_localversion is defined and target_linux_localversion != ""
8385

@@ -102,6 +104,7 @@
102104

103105
- name: Build {{ target_linux_tree }} cxl_test on the target nodes
104106
ansible.builtin.command: "{{ target_linux_make_cmd }} M=tools/testing/cxl"
107+
changed_when: false
105108
register: build_cxl_test
106109
changed_when: "build_cxl_test.rc == 0"
107110
args:

playbooks/roles/bootlinux/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@
213213

214214
- name: Run uname before
215215
ansible.builtin.command: "uname -r"
216+
changed_when: false
216217
register: uname_cmd_before
217218
tags: ["uninstall-linux"]
218219

@@ -328,6 +329,7 @@
328329
become_flags: "su - -c"
329330
become_method: ansible.builtin.sudo
330331
ansible.builtin.command: "{{ target_linux_make_install_cmd }} M=tools/testing/cxl INSTALL_MOD_DIR=updates"
332+
changed_when: false
331333
register: install_done
332334
changed_when: "install_done.rc == 0"
333335
args:
@@ -348,6 +350,7 @@
348350

349351
- name: Run uname
350352
ansible.builtin.command: "uname -r"
353+
changed_when: false
351354
register: uname_cmd
352355
tags: ["uname"]
353356

playbooks/roles/bootlinux/tasks/update-grub/redhat.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
become_flags: "su - -c"
55
become_method: ansible.builtin.sudo
66
ansible.builtin.command: grub2-editenv - unset menu_auto_hide
7+
changed_when: false
78
- name: Determine if system was booted using UEFI
89
ansible.builtin.stat:
910
path: /sys/firmware/efi/efivars

playbooks/roles/build_qemu/tasks/install-deps/fedora/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
- name: Verify local build QEMU installation
33
ansible.builtin.command: "which qemu-system-x86_64"
4+
changed_when: false
45
register: qemu_present
56
changed_when: qemu_present.rc == 1
67
failed_when: qemu_present.rc != 0 and qemu_present.rc != 1

playbooks/roles/cxl/tasks/cxl-create-dc-region/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
become: true
44
become_method: ansible.builtin.sudo
55
ansible.builtin.shell: "rid=0; region=$(cat /sys/bus/cxl/devices/decoder0.0/create_dc_region); echo $region > /sys/bus/cxl/devices/decoder0.0/create_dc_region;
6+
changed_when: false
67
echo 256 > /sys/bus/cxl/devices/$region/interleave_granularity; echo 1 > /sys/bus/cxl/devices/$region/interleave_ways; echo dc$rid >/sys/bus/cxl/devices/decoder2.0/mode;
78
echo 0x40000000 >/sys/bus/cxl/devices/decoder2.0/dpa_size; echo 0x40000000 > /sys/bus/cxl/devices/$region/size; echo decoder2.0 > /sys/bus/cxl/devices/$region/target0;
89
echo 1 > /sys/bus/cxl/devices/$region/commit; echo $region > /sys/bus/cxl/drivers/cxl_region/bind"

playbooks/roles/cxl/tasks/cxl-dcd-setup/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
- name: Add DC extents to the hosts
33
ansible.builtin.shell: " qmp_port_str={{ qmp_port_str }}; qmp_port=`echo $qmp_port_str | awk -F'[^0-9]+' '{ print $2 }'`;qmp_str=' { \"execute\": \"qmp_capabilities\"\
4+
changed_when: false
45
\ } { \"execute\": \"cxl-add-dynamic-capacity\", \"arguments\": { \"path\": \"/machine/peripheral/kdevops-cxl-dcd0\", \"region-id\": 0, \"extents\": [ { \"offset\"\
56
: 0, \"len\": 128 }, { \"offset\": 128, \"len\": 256 } ] } } '; echo $qmp_str | ncat localhost $qmp_port"
67
register: command_output
@@ -14,6 +15,7 @@
1415
- name: Show DC extents added
1516
become: false
1617
ansible.builtin.command: "ls /sys/bus/cxl/devices/decoder0.0/region0/dax_region0/ -lt"
18+
changed_when: false
1719
register: command_output
1820
tags: ["cxl-dcd-setup"]
1921

@@ -35,6 +37,7 @@
3537
- name: Show dax devices added
3638
become: false
3739
ansible.builtin.shell: "ls /dev/dax* -lt"
40+
changed_when: false
3841
register: command_output
3942
tags: ["cxl-dcd-setup"]
4043

@@ -56,6 +59,7 @@
5659
- name: Show system memory with lsmem
5760
become: false
5861
ansible.builtin.command: "lsmem"
62+
changed_when: false
5963
register: command_output
6064
tags: ["cxl-dcd-setup"]
6165

playbooks/roles/cxl/tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
- name: Get used target kernel version
8181
tags: ["ndctl", "cxl-test-prep", "copy_results"]
8282
ansible.builtin.command: "uname -r"
83+
changed_when: false
8384
register: uname_cmd
8485

8586
- name: Store last kernel variable
@@ -183,6 +184,7 @@
183184

184185
- name: Document used target kernel version
185186
ansible.builtin.shell: echo {{ last_kernel }} > {{ cxl_results_target }}/last-kernel.txt
187+
changed_when: false
186188
delegate_to: localhost
187189
run_once: true
188190
tags: ["ndctl", "cxl-test-meson", "copy_results"]

playbooks/roles/devconfig/tasks/install-deps/debian/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
become_flags: "su - -c"
111111
become_method: ansible.builtin.sudo
112112
ansible.builtin.command: "apt-get update --allow-releaseinfo-change -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false -o Acquire::AllowInsecureRepositories=true
113+
changed_when: false
113114
-o Acquire::MaxDate=10"
114115
register: release_info_changed
115116
changed_when: release_info_changed.rc == 0
@@ -119,6 +120,7 @@
119120

120121
- name: Check for UNAVAIL in /etc/nsswitch.conf hosts line
121122
ansible.builtin.shell: grep -E '^hosts:.*UNAVAIL' /etc/nsswitch.conf
123+
changed_when: false
122124
register: nsswitch_check
123125
changed_when: false
124126
failed_when: false

0 commit comments

Comments
 (0)