Skip to content

Commit c695962

Browse files
committed
playbooks: all: add changed_when
Fix Ansible lint errors. Avoid duplicates and ensure proper indentation. Signed-off-by: Daniel Gomez <[email protected]>
1 parent 5db88b8 commit c695962

File tree

28 files changed

+64
-1
lines changed

28 files changed

+64
-1
lines changed

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: 2 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

playbooks/roles/bootlinux/tasks/main.yml

Lines changed: 2 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

@@ -348,6 +349,7 @@
348349

349350
- name: Run uname
350351
ansible.builtin.command: "uname -r"
352+
changed_when: false
351353
register: uname_cmd
352354
tags: ["uname"]
353355

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/cxl/tasks/cxl-create-dc-region/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- name: Create a DC region before DC extents can be added
33
become: true
44
become_method: ansible.builtin.sudo
5+
changed_when: false
56
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;
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;

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/suse/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@
446446
become_flags: "su - -c"
447447
become_method: ansible.builtin.sudo
448448
ansible.builtin.shell: kdumptool calibrate | grep ^High | awk '{print $2}'
449+
changed_when: false
449450
register: kdump_high
450451
when:
451452
- install_kdump|bool
@@ -458,6 +459,7 @@
458459
become_flags: "su - -c"
459460
become_method: ansible.builtin.sudo
460461
ansible.builtin.shell: kdumptool calibrate | grep ^Low | awk '{print $2}'
462+
changed_when: false
461463
register: kdump_low
462464
when:
463465
- install_kdump|bool

playbooks/roles/devconfig/tasks/kotd-rev-kernel/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@
2626
- name: Get used target kernel version prior to reving kernel
2727
tags: ["kotd"]
2828
ansible.builtin.command: "uname -r"
29+
changed_when: false
2930
register: uname_cmd
3031

3132
- name: Document used target kernel version prior to reving kernel
3233
ansible.builtin.shell: echo {{ uname_cmd.stdout_lines | regex_replace('\]') | regex_replace('\[') }} > {{ kotd_uname_before }}
34+
changed_when: false
3335
delegate_to: localhost
3436
tags: ["kotd"]
3537
run_once: true
@@ -60,10 +62,12 @@
6062
- name: Get used target kernel version after reving kernel
6163
tags: ["kotd"]
6264
ansible.builtin.command: "uname -r"
65+
changed_when: false
6366
register: uname_cmd
6467

6568
- name: Document used target kernel version after reving kernel
6669
ansible.builtin.shell: echo {{ uname_cmd.stdout_lines | regex_replace('\]') | regex_replace('\[') }} > {{ kotd_uname_after }}
70+
changed_when: false
6771
delegate_to: localhost
6872
tags: ["kotd"]
6973
run_once: true

0 commit comments

Comments
 (0)