Skip to content

Commit

Permalink
Cs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed Jun 24, 2021
1 parent a928434 commit e5f8e8a
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,55 @@

- block:

- name: write swap file
command: >
fallocate -l {{ swapfile_size }} {{ swapfile_file }}
args:
creates: "{{ swapfile_file }}"
warn: false
register: _write_swapfile
tags:
- swapfile-write-file
- name: write swap file
command: >
fallocate -l {{ swapfile_size }} {{ swapfile_file }}
args:
creates: "{{ swapfile_file }}"
warn: false
register: _write_swapfile
tags:
- swapfile-write-file

- name: set swap file permissions
file:
path: "{{ swapfile_file }}"
owner: root
group: root
mode: 0600
tags:
- swapfile-set-file-permissions
- name: set swap file permissions
file:
path: "{{ swapfile_file }}"
owner: root
group: root
mode: 0600
tags:
- swapfile-set-file-permissions

- name: create swap file
command: >
mkswap {{ swapfile_file }}
args:
warn: false
register: _create_swapfile
when: _write_swapfile.changed
tags:
- swapfile-mkswap
- name: create swap file
command: >
mkswap {{ swapfile_file }}
args:
warn: false
register: _create_swapfile
when: _write_swapfile.changed
tags:
- swapfile-mkswap

- name: enable swapfile
command: >
swapon {{ swapfile_file }}
args:
warn: false
when: _create_swapfile is changed
tags:
- swapfile-enable-swapfile
- name: enable swapfile
command: >
swapon {{ swapfile_file }}
args:
warn: false
when: _create_swapfile is changed
tags:
- swapfile-enable-swapfile

- name: add swapfile to /etc/fstab
mount:
name: none
src: "{{ swapfile_file }}"
fstype: swap
opts: sw
passno: '0'
dump: '0'
state: present
tags:
- swapfile-fstab
- name: add swapfile to /etc/fstab
mount:
name: none
src: "{{ swapfile_file }}"
fstype: swap
opts: sw
passno: '0'
dump: '0'
state: present
tags:
- swapfile-fstab

# TODO: Changing this to `when: swapfile_size` seems to fail, find out why
when: swapfile_size != false
Expand Down

0 comments on commit e5f8e8a

Please sign in to comment.