Update main.yml

This commit is contained in:
qiaofeng1227 2023-04-03 15:18:52 +08:00 committed by GitHub
parent 74c8f80862
commit 25348e7dc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,27 +11,7 @@
- debug:
msg: "Cloud platform is {{ cloud.stdout}}"
- block:
- name: Close swap Space
command: swapoff -a
- name: Create swap Space
command: dd if=/dev/zero of=/mnt/swap bs=256M count=8
- name: Make swap
command: mkswap /mnt/swap
- name: Action swap
command: swapon /mnt/swap
- name: Add to fstab
lineinfile:
dest: /etc/fstab
regexp: '/mnt/swap'
line: "/mnt/swap swap swap defaults 0 0"
state: present
when: (ansible_swaptotal_mb == 0) and (cloud.stdout != 'azure')
- block:
- name: Change ubuntu service name