More lint
This commit is contained in:
parent
9bae994269
commit
54728a8acb
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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
|
||||||
|
|
Reference in a new issue