Skip to content
Snippets Groups Projects
Verified Commit f28d3ba5 authored by Evangelos Foutras's avatar Evangelos Foutras :smiley_cat:
Browse files

ansible-lint: address no-changed-when fatal errors

Liberally add "noqa no-changed-when" tags to the problematic tasks,
except for two "systemd-tmpfiles --create" calls. For these we can
simply include the creates= parameter in the command module's call.
parent 3ac1bac0
No related branches found
No related tags found
No related merge requests found
Pipeline #53270 passed
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
become_user: archmanweb become_user: archmanweb
register: release register: release
- name: Build archlinux-common-style - name: Build archlinux-common-style # noqa no-changed-when
command: command:
cmd: make SASS=sassc cmd: make SASS=sassc
chdir: "{{ archmanweb_dir }}/repo/archlinux-common-style" chdir: "{{ archmanweb_dir }}/repo/archlinux-common-style"
......
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
priv="{{ aurweb_db }}.*:ALL" priv="{{ aurweb_db }}.*:ALL"
no_log: true no_log: true
- name: Initialize the database - name: Initialize the database # noqa no-changed-when
command: poetry run python -m aurweb.initdb command: poetry run python -m aurweb.initdb
args: args:
chdir: "{{ aurweb_dir }}" chdir: "{{ aurweb_dir }}"
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
become_user: "{{ aurweb_user }}" become_user: "{{ aurweb_user }}"
when: db_created.changed when: db_created.changed
- name: Run migrations - name: Run migrations # noqa no-changed-when
command: poetry run alembic upgrade head command: poetry run alembic upgrade head
args: args:
chdir: "{{ aurweb_dir }}" chdir: "{{ aurweb_dir }}"
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
ignore_errors: true ignore_errors: true
register: aurweb_installed register: aurweb_installed
- name: Install python module - name: Install python module # noqa no-changed-when
command: poetry install command: poetry install
args: args:
chdir: "{{ aurweb_dir }}" chdir: "{{ aurweb_dir }}"
...@@ -283,7 +283,7 @@ ...@@ -283,7 +283,7 @@
chdir: "{{ aurweb_git_dir }}" chdir: "{{ aurweb_git_dir }}"
failed_when: git_config.rc == 2 # FIXME: does not work. failed_when: git_config.rc == 2 # FIXME: does not work.
- name: Configure git tranfser.hideRefs # noqa command-instead-of-module - name: Configure git tranfser.hideRefs # noqa command-instead-of-module no-changed-when
command: git config --local transfer.hideRefs '^refs/' command: git config --local transfer.hideRefs '^refs/'
args: args:
chdir: "{{ aurweb_git_dir }}" chdir: "{{ aurweb_git_dir }}"
...@@ -291,7 +291,7 @@ ...@@ -291,7 +291,7 @@
become_user: "{{ aurweb_user }}" become_user: "{{ aurweb_user }}"
when: git_config.stdout.find('^refs/') == -1 when: git_config.stdout.find('^refs/') == -1
- name: Configure git transfer.hideRefs second # noqa command-instead-of-module - name: Configure git transfer.hideRefs second # noqa command-instead-of-module no-changed-when
command: git config --local --add transfer.hideRefs '!refs/' command: git config --local --add transfer.hideRefs '!refs/'
args: args:
chdir: "{{ aurweb_git_dir }}" chdir: "{{ aurweb_git_dir }}"
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
become_user: "{{ aurweb_user }}" become_user: "{{ aurweb_user }}"
when: git_config.stdout.find('!refs/') == -1 when: git_config.stdout.find('!refs/') == -1
- name: Configure git transfer.hideRefs third # noqa command-instead-of-module - name: Configure git transfer.hideRefs third # noqa command-instead-of-module no-changed-when
command: git config --local --add transfer.hideRefs '!HEAD' command: git config --local --add transfer.hideRefs '!HEAD'
args: args:
chdir: "{{ aurweb_git_dir }}" chdir: "{{ aurweb_git_dir }}"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
loop: "{{ backup_hosts }}" loop: "{{ backup_hosts }}"
changed_when: borg_list.stdout | length > 0 changed_when: borg_list.stdout | length > 0
- name: Init borg repository # noqa ignore-errors - name: Init borg repository # noqa ignore-errors no-changed-when
command: "{{ item['borg_cmd'] }} init -e keyfile {{ item['host'] }}/{{ item['dir'] }}" command: "{{ item['borg_cmd'] }} init -e keyfile {{ item['host'] }}/{{ item['dir'] }}"
when: borg_list is failed when: borg_list is failed
environment: environment:
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
register: zramtmpfiles register: zramtmpfiles
when: enable_zram_swap when: enable_zram_swap
- name: Use tmpfiles.d/zram.conf - name: Use tmpfiles.d/zram.conf # noqa no-changed-when
command: systemd-tmpfiles --create command: systemd-tmpfiles --create
when: zramtmpfiles.changed when: zramtmpfiles.changed
......
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
register: rsyncdtmpfiles register: rsyncdtmpfiles
- name: Use tmpfiles.d/rsyncd.conf - name: Use tmpfiles.d/rsyncd.conf
command: systemd-tmpfiles --create command: systemd-tmpfiles --create creates=/run/rsyncd
when: rsyncdtmpfiles.changed when: rsyncdtmpfiles.changed
- name: Create rsyncd-conf-genscripts - name: Create rsyncd-conf-genscripts
......
...@@ -38,11 +38,11 @@ ...@@ -38,11 +38,11 @@
register: sgdisk register: sgdisk
changed_when: "sgdisk.rc == 0" changed_when: "sgdisk.rc == 0"
- name: Partition and format the disks (btrfs RAID) - name: Partition and format the disks (btrfs RAID) # noqa no-changed-when
command: mkfs.btrfs -f -L root -d {{ raid_level | default('raid1') }} -m {{ raid_level | default('raid1') }} -O no-holes {{ system_disks | map('regex_replace', '^(.*)$', '\g<1>p2' if 'nvme' in system_disks[0] else '\g<1>2') | join(' ') }} command: mkfs.btrfs -f -L root -d {{ raid_level | default('raid1') }} -m {{ raid_level | default('raid1') }} -O no-holes {{ system_disks | map('regex_replace', '^(.*)$', '\g<1>p2' if 'nvme' in system_disks[0] else '\g<1>2') | join(' ') }}
when: filesystem == "btrfs" and system_disks | length >= 2 when: filesystem == "btrfs" and system_disks | length >= 2
- name: Partition and format the disks (btrfs single) - name: Partition and format the disks (btrfs single) # noqa no-changed-when
command: mkfs.btrfs -f -L root -d single -m single -O no-holes {{ system_disks[0] }}{{ 'p2' if 'nvme' in system_disks[0] else '2' }} command: mkfs.btrfs -f -L root -d single -m single -O no-holes {{ system_disks[0] }}{{ 'p2' if 'nvme' in system_disks[0] else '2' }}
when: filesystem == "btrfs" and system_disks | length == 1 when: filesystem == "btrfs" and system_disks | length == 1
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
become_user: postgres become_user: postgres
become_method: su become_method: su
- name: Run Django management tasks - name: Run Django management tasks # noqa no-changed-when
command: django-admin {{ item }} --pythonpath /etc/webapps/mailman-web --settings settings command: django-admin {{ item }} --pythonpath /etc/webapps/mailman-web --settings settings
loop: loop:
- migrate - migrate
......
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
become_method: sudo become_method: sudo
when: mjolnir_git.changed when: mjolnir_git.changed
- name: Build mjolnir - name: Build mjolnir # noqa no-changed-when
command: yarn build command: yarn build
args: args:
chdir: /var/lib/synapse/mjolnir chdir: /var/lib/synapse/mjolnir
......
...@@ -6,5 +6,5 @@ ...@@ -6,5 +6,5 @@
register: memcachedtmpfiles register: memcachedtmpfiles
- name: Use tmpfiles.d/memcached.conf - name: Use tmpfiles.d/memcached.conf
command: systemd-tmpfiles --create command: systemd-tmpfiles --create creates=/run/memcached
when: memcachedtmpfiles.changed when: memcachedtmpfiles.changed
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment