Visual Studio Code Editor for Ansible on RHEL8

step1: Import Microsoft GPG key

sudo rpm --import

step2: create the following repo file to enable the Visual Studio Code repository
sudo vi /etc/yum.repos.d/vscode.repo

Paste the following content into the file:

name=Visual Studio Code


step3: Install Visual Studio Code Editor
sudo yum install code

step4: Launch visual studio code using termainal
code .

step5: Add Required Extensions

ansible extention/plugin


step6: Install Required Extensions


Step7 I create test playbook to test

I find some disk.yml on

lets test it 🙂

$ vi disk.yml
- hosts: win
  - name: Get disk facts

  - name: Output first disk size
      var: ansible_facts.disks[0].size

  - name: Convert first system disk into various formats
      msg: '{{ disksize_gib }} vs {{ disksize_gib_human }}'
      # Get first system disk
      disk: '{{ ansible_facts.disks|selectattr("system_disk")|first }}'

      # Show disk size in Gibibytes
      disksize_gib_human: '{{ disk.size|filesizeformat(true) }}'
      disksize_gib: '{{ (disk.size/1024|pow(3))|round|int }} GiB'

Step8: Right click and Run Ansible Playbook Remotly via SSH


Step9: Add (hostname, port  , user, password )

hostname-  Ansible server ( 

port: 22

SSH username : 

password: XXXXXX


You should see on terminal some input from you servers

Thanks more Ansible soon 🙂





 79 total views,  1 views today

Leave a Reply

Your email address will not be published. Required fields are marked *