More lint
This commit is contained in:
parent
9bae994269
commit
54728a8acb
|
@ -62,6 +62,7 @@ warn_list:
|
|||
- skip_this_tag
|
||||
- experimental # experimental is included in the implicit list
|
||||
- no-changed-when
|
||||
- latest[git]
|
||||
# - role-name
|
||||
# - yaml[document-start] # you can also use sub-rule matches
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
- name: Deploy self-hosted services
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
gather_facts: true
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
|
|
|
@ -40,9 +40,17 @@
|
|||
connect_timeout: 120
|
||||
when: needs_reboot.stat.exists or
|
||||
(force_reboot is defined and force_reboot)
|
||||
register: reboot
|
||||
tags:
|
||||
- reboot
|
||||
|
||||
- name: Re-gather facts
|
||||
setup:
|
||||
filter:
|
||||
- ansible_mounts
|
||||
- ansible_swaptotal_mb
|
||||
when: reboot.rebooted
|
||||
|
||||
- name: Clone apt-update-push
|
||||
git:
|
||||
dest: "/home/{{ ansible_user }}/apt-update-push"
|
||||
|
|
|
@ -13,10 +13,6 @@
|
|||
- disk: "{{ secrets.ssd }}"
|
||||
name: "{{ ssd_name }}"
|
||||
|
||||
- name: Get list of mounted devices
|
||||
command: mount
|
||||
register: mounted_devices
|
||||
|
||||
- name: Create filesystems if they do not exist
|
||||
filesystem:
|
||||
dev: "{{ item }}"
|
||||
|
@ -25,7 +21,7 @@
|
|||
loop:
|
||||
- "/dev/mapper/{{ hdd_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
|
||||
mount:
|
||||
|
@ -39,12 +35,7 @@
|
|||
path: "{{ hdd_mount_point }}"
|
||||
- dev: "/dev/mapper/{{ ssd_name }}"
|
||||
path: "{{ ssd_mount_point }}"
|
||||
when: mounted_devices.stdout | regex_search(item.dev) is none
|
||||
|
||||
- name: Check if swapfile is mounted
|
||||
shell: "swapon | grep -q '{{ ssd_mount_point }}/swapfile'"
|
||||
ignore_errors: true
|
||||
register: swap_mounted
|
||||
when: ansible_mounts | selectattr('device', 'eq', item.dev) | length == 0
|
||||
|
||||
- name: Create swapfile
|
||||
community.general.filesize:
|
||||
|
@ -53,10 +44,10 @@
|
|||
blocksize: 512B
|
||||
owner: root
|
||||
mode: u=rw,go=
|
||||
when: swap_mounted.rc != 0
|
||||
when: ansible_swaptotal_mb == 0
|
||||
|
||||
- name: Mount swapfile
|
||||
shell: |
|
||||
mkswap {{ ssd_mount_point }}/swapfile
|
||||
swapon {{ ssd_mount_point }}/swapfile
|
||||
when: swap_mounted.rc != 0
|
||||
when: ansible_swaptotal_mb == 0
|
||||
|
|
Reference in a new issue