How to disable swap in remote system using Ansible

0 votes

Hi Guys,

I am trying to configure the Kubernetes Cluster using the Ansible playbook. But Kubelet will not start if the system has swap enabled, so I need to disable swap. But how can I disable swap using Ansible?

Sep 16, 2020 in Ansible by akhtar
• 38,260 points
7,660 views

1 answer to this question.

+2 votes

Hi@akhtar,

You can use the mount module in your playbook. This module is used to mount any drive to a folder. But we can use this module to remove swapfile as well. You can see the below example.

  - name: Remove swapfile from /etc/fstab
    mount:
      name: "{{ item }}"
      fstype: swap
      state: absent
    with_items:
      - swap
answered Sep 16, 2020 by MD
• 95,460 points

Related Questions In Ansible

0 votes
1 answer

How to install httpd web server in remote node using Ansible?

Hi@akhtar, You need to use the package module in Ansible. ...READ MORE

answered Jul 30, 2020 in Ansible by MD
• 95,460 points
2,596 views
0 votes
1 answer

How to overwrite the content of a file in remote systems using Ansible playbook?

Hi@akhtar, You can find one argument in the ...READ MORE

answered Aug 2, 2020 in Ansible by MD
• 95,460 points
14,403 views
0 votes
1 answer

How to find the memory of remote systems using the setup module in Ansible?

Hi@akhtar, You need to use the setup module to ...READ MORE

answered Aug 10, 2020 in Ansible by MD
• 95,460 points
5,881 views
0 votes
1 answer

How to filter IP address of remote system in Ansible?

Hi@akhtar, You can use the filter keyword in your ...READ MORE

answered Aug 20, 2020 in Ansible by MD
• 95,460 points
2,359 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,035 views
+2 votes
1 answer
0 votes
1 answer

How to copy files in remote system using Ansible?

Hi@akhtar, You need to use the copy module ...READ MORE

answered Jul 30, 2020 in Ansible by MD
• 95,460 points
2,387 views
0 votes
1 answer

How to start httpd service in a remote system using Ansible?

Hi@akhtar, Ansible has a module named service. This ...READ MORE

answered Jul 30, 2020 in Ansible by MD
• 95,460 points
3,368 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP