More lint

This commit is contained in:
Sam A. 2022-12-26 00:53:10 +01:00
parent 9bae994269
commit 54728a8acb
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
4 changed files with 14 additions and 14 deletions

View file

@ -62,6 +62,7 @@ warn_list:
- skip_this_tag - skip_this_tag
- experimental # experimental is included in the implicit list - experimental # experimental is included in the implicit list
- no-changed-when - no-changed-when
- latest[git]
# - role-name # - role-name
# - yaml[document-start] # you can also use sub-rule matches # - yaml[document-start] # you can also use sub-rule matches

View file

@ -1,7 +1,7 @@
--- ---
- name: Deploy self-hosted services - name: Deploy self-hosted services
hosts: all hosts: all
gather_facts: false gather_facts: true
become: true become: true
tasks: tasks:

View file

@ -40,9 +40,17 @@
connect_timeout: 120 connect_timeout: 120
when: needs_reboot.stat.exists or when: needs_reboot.stat.exists or
(force_reboot is defined and force_reboot) (force_reboot is defined and force_reboot)
register: reboot
tags: tags:
- reboot - reboot
- name: Re-gather facts
setup:
filter:
- ansible_mounts
- ansible_swaptotal_mb
when: reboot.rebooted
- name: Clone apt-update-push - name: Clone apt-update-push
git: git:
dest: "/home/{{ ansible_user }}/apt-update-push" dest: "/home/{{ ansible_user }}/apt-update-push"

View file

@ -13,10 +13,6 @@
- disk: "{{ secrets.ssd }}" - disk: "{{ secrets.ssd }}"
name: "{{ ssd_name }}" name: "{{ ssd_name }}"
- name: Get list of mounted devices
command: mount
register: mounted_devices
- name: Create filesystems if they do not exist - name: Create filesystems if they do not exist
filesystem: filesystem:
dev: "{{ item }}" dev: "{{ item }}"
@ -25,7 +21,7 @@
loop: loop:
- "/dev/mapper/{{ hdd_name }}" - "/dev/mapper/{{ hdd_name }}"
- "/dev/mapper/{{ ssd_name }}" - "/dev/mapper/{{ ssd_name }}"
when: mounted_devices.stdout | regex_search(item) is none when: ansible_mounts | selectattr('device', 'eq', item) | length == 0
- name: Mount filesystems - name: Mount filesystems
mount: mount:
@ -39,12 +35,7 @@
path: "{{ hdd_mount_point }}" path: "{{ hdd_mount_point }}"
- dev: "/dev/mapper/{{ ssd_name }}" - dev: "/dev/mapper/{{ ssd_name }}"
path: "{{ ssd_mount_point }}" path: "{{ ssd_mount_point }}"
when: mounted_devices.stdout | regex_search(item.dev) is none when: ansible_mounts | selectattr('device', 'eq', item.dev) | length == 0
- name: Check if swapfile is mounted
shell: "swapon | grep -q '{{ ssd_mount_point }}/swapfile'"
ignore_errors: true
register: swap_mounted
- name: Create swapfile - name: Create swapfile
community.general.filesize: community.general.filesize:
@ -53,10 +44,10 @@
blocksize: 512B blocksize: 512B
owner: root owner: root
mode: u=rw,go= mode: u=rw,go=
when: swap_mounted.rc != 0 when: ansible_swaptotal_mb == 0
- name: Mount swapfile - name: Mount swapfile
shell: | shell: |
mkswap {{ ssd_mount_point }}/swapfile mkswap {{ ssd_mount_point }}/swapfile
swapon {{ ssd_mount_point }}/swapfile swapon {{ ssd_mount_point }}/swapfile
when: swap_mounted.rc != 0 when: ansible_swaptotal_mb == 0