mirror of
https://gitlab.archlinux.org/archlinux/infrastructure.git
synced 2024-05-08 17:56:03 +02:00
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.
This commit is contained in:
parent
3ac1bac037
commit
f28d3ba595
|
@ -51,7 +51,7 @@
|
|||
become_user: archmanweb
|
||||
register: release
|
||||
|
||||
- name: Build archlinux-common-style
|
||||
- name: Build archlinux-common-style # noqa no-changed-when
|
||||
command:
|
||||
cmd: make SASS=sassc
|
||||
chdir: "{{ archmanweb_dir }}/repo/archlinux-common-style"
|
||||
|
|
|
@ -151,7 +151,7 @@
|
|||
priv="{{ aurweb_db }}.*:ALL"
|
||||
no_log: true
|
||||
|
||||
- name: Initialize the database
|
||||
- name: Initialize the database # noqa no-changed-when
|
||||
command: poetry run python -m aurweb.initdb
|
||||
args:
|
||||
chdir: "{{ aurweb_dir }}"
|
||||
|
@ -159,7 +159,7 @@
|
|||
become_user: "{{ aurweb_user }}"
|
||||
when: db_created.changed
|
||||
|
||||
- name: Run migrations
|
||||
- name: Run migrations # noqa no-changed-when
|
||||
command: poetry run alembic upgrade head
|
||||
args:
|
||||
chdir: "{{ aurweb_dir }}"
|
||||
|
@ -178,7 +178,7 @@
|
|||
ignore_errors: true
|
||||
register: aurweb_installed
|
||||
|
||||
- name: Install python module
|
||||
- name: Install python module # noqa no-changed-when
|
||||
command: poetry install
|
||||
args:
|
||||
chdir: "{{ aurweb_dir }}"
|
||||
|
@ -283,7 +283,7 @@
|
|||
chdir: "{{ aurweb_git_dir }}"
|
||||
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/'
|
||||
args:
|
||||
chdir: "{{ aurweb_git_dir }}"
|
||||
|
@ -291,7 +291,7 @@
|
|||
become_user: "{{ aurweb_user }}"
|
||||
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/'
|
||||
args:
|
||||
chdir: "{{ aurweb_git_dir }}"
|
||||
|
@ -299,7 +299,7 @@
|
|||
become_user: "{{ aurweb_user }}"
|
||||
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'
|
||||
args:
|
||||
chdir: "{{ aurweb_git_dir }}"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
loop: "{{ backup_hosts }}"
|
||||
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'] }}"
|
||||
when: borg_list is failed
|
||||
environment:
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
register: zramtmpfiles
|
||||
when: enable_zram_swap
|
||||
|
||||
- name: Use tmpfiles.d/zram.conf
|
||||
- name: Use tmpfiles.d/zram.conf # noqa no-changed-when
|
||||
command: systemd-tmpfiles --create
|
||||
when: zramtmpfiles.changed
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@
|
|||
register: rsyncdtmpfiles
|
||||
|
||||
- name: Use tmpfiles.d/rsyncd.conf
|
||||
command: systemd-tmpfiles --create
|
||||
command: systemd-tmpfiles --create creates=/run/rsyncd
|
||||
when: rsyncdtmpfiles.changed
|
||||
|
||||
- name: Create rsyncd-conf-genscripts
|
||||
|
|
|
@ -38,11 +38,11 @@
|
|||
register: sgdisk
|
||||
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(' ') }}
|
||||
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' }}
|
||||
when: filesystem == "btrfs" and system_disks | length == 1
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
become_user: postgres
|
||||
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
|
||||
loop:
|
||||
- migrate
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
become_method: sudo
|
||||
when: mjolnir_git.changed
|
||||
|
||||
- name: Build mjolnir
|
||||
- name: Build mjolnir # noqa no-changed-when
|
||||
command: yarn build
|
||||
args:
|
||||
chdir: /var/lib/synapse/mjolnir
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
register: memcachedtmpfiles
|
||||
|
||||
- name: Use tmpfiles.d/memcached.conf
|
||||
command: systemd-tmpfiles --create
|
||||
command: systemd-tmpfiles --create creates=/run/memcached
|
||||
when: memcachedtmpfiles.changed
|
||||
|
|
Loading…
Reference in New Issue