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,170 points
926 views

1 answer to this question.

0 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,060 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 29, 2020 in Ansible by MD
• 95,060 points
462 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,060 points
2,175 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,060 points
764 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,060 points
366 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
954 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,060 points
218 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,060 points
356 views