Files
fedora-infra_ansible/roles/copr/backend/tasks/mount_fs.yml
Michal Konecny 2ec055db6f Use first uppercase letter for all handlers
This will unify all the handlers to use first uppercase letter for
ansible-lint to stop complaining.

I went through all `notify:` occurrences and fixed them by running
```
set TEXT "text_to_replace"; set REPLACEMENT "replacement_text"; git grep
-rlz "$TEXT" . | xargs -0 sed -i "s/$TEXT/$REPLACEMENT/g"
```

Then I went through all the changes and removed the ones that wasn't
expected to be changed.

Fixes https://pagure.io/fedora-infrastructure/issue/12391

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2025-02-10 20:31:49 +00:00

80 lines
2.2 KiB
YAML

---
- name: Install the lvm2 package
dnf: state=present name=lvm2
- name: Early stat for the ext4 filesystem
stat: path=/dev/disk/by-label/copr-repo
register: stat_repo_fs_early
tags: mdadm
- name: Install LVM and RAID utilities
ansible.builtin.package:
name:
- lvm2
- mdadm
tags:
- mdadm
- name: VG on two RAIDs
tags: mdadm
when: not stat_repo_fs_early.stat.exists
block:
- name: Stat the raid volumes
stat:
path: "/dev/disk/by-id/{{ item }}"
register: stat_raid
loop: "{{ copr_backend_data_raid10_volumes + copr_backend_data_2_raid1_volumes }}"
- name: Fail if raid volumes do not exist
debug: msg=checked
failed_when: not item.stat.exists
loop: "{{ stat_raid.results }}"
- name: Stat the ext4 filesystem
stat: path=/dev/disk/by-label/copr-repo
register: stat_repo_fs
- name: Scan and assemble raid volumes and activate volume groups
when: not stat_repo_fs.stat.exists
ansible.builtin.shell: mdadm --assemble --scan && sleep 10 && vgchange -a y && sleep 5 && vgchange copr-backend-data --setautoactivation y && sleep 5
- name: Stat the ext4 filesystem
stat: path=/dev/disk/by-label/copr-repo
register: stat_repo_fs
- name: Fail if ext4 filesystem is not found by devmapper
debug: msg=checked
failed_when: not stat_repo_fs.stat.exists
- name: Decrease the RAID checks frequency in AWS
tags:
- mdadm
- raid
- raid_check
when: datacenter == 'aws'
block:
- name: Install the drop-in raid-check.timer override
ansible.builtin.copy:
dest: /etc/systemd/system/raid-check.timer
content: |
[Unit]
Description=Monthly RAID health check in AWS
[Timer]
OnCalendar=Sat *-*-8..14 01:00:00
Persistent=true
AccuracySec=24h
[Install]
WantedBy=timers.target
notify: Systemctl daemon-reload
- name: Prepare mount point
ansible.builtin.file: state=directory path=/var/lib/copr/public_html
- name: Mount up disk of copr repo
mount: name=/var/lib/copr/public_html src='LABEL=copr-repo' fstype=ext4 state=mounted opts=nofail
- name: Mount /tmp/
mount: name=/tmp src='tmpfs' fstype=tmpfs state=mounted