Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Complete DevOps SnippetsNew to Visual Studio Code? Get it now.
Complete DevOps Snippets

Complete DevOps Snippets

pangestugalih

|
16 installs
| (0) | Free
A comprehensive collection of snippets for DevOps tools including Ansible, Kubernetes, Terraform, Docker, CI/CD, and Network configurations to accelerate your infrastructure workflows.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

DevOps Snippets

This extension provides a comprehensive collection of snippets for DevOps tools including Ansible, Kubernetes, Terraform, Docker, CI/CD pipelines, and Network configurations to accelerate your infrastructure and automation workflows.

Installation

  1. Open Visual Studio Code
  2. Go to Extensions (or press Ctrl+Shift+X)
  3. Search for "DevOps Snippets"
  4. Click Install

Usage

The snippets are available across multiple languages and file types:

YAML Files (Ansible, Kubernetes, Docker Compose, GitHub Actions)

  1. Open a YAML file
  2. Start typing the prefix of the snippet you want to use (e.g., ansible-, k8s-, docker-compose-, gh-)
  3. Select the snippet from the IntelliSense popup
  4. Press Tab to navigate through the placeholders

Terraform Files (.tf)

  1. Open a Terraform file
  2. Start typing tf- followed by the resource type
  3. Select the snippet and customize the parameters

Dockerfile

  1. Open a Dockerfile
  2. Start typing docker- for Dockerfile instructions and best practices

Jenkins Pipeline (Groovy)

  1. Open a Jenkinsfile or .groovy file
  2. Start typing jenkins- for pipeline templates

Network Configuration Files

  1. Open nginx.conf, haproxy.cfg, or YAML files for Traefik
  2. Start typing nginx-, haproxy-, or traefik- respectively

Features

This extension offers comprehensive snippets across the entire DevOps toolchain:

🔧 Ansible Automation

Complete Ansible module snippets with full and simple variants for infrastructure automation and configuration management.

☸️ Kubernetes Resources

Comprehensive Kubernetes resource templates including core resources, advanced configurations, Istio service mesh, Prometheus monitoring, and GitOps tools (ArgoCD/Flux).

🏗️ Infrastructure as Code (Terraform)

Extensive Terraform snippets covering AWS, Azure, and GCP resources with security best practices and advanced patterns.

🐳 Containerization (Docker)

Docker and Docker Compose templates for multi-stage builds, development environments, and production deployments.

🚀 CI/CD Pipelines

Ready-to-use GitHub Actions workflows and Jenkins pipeline templates for automated testing, building, and deployment.

🌐 Network Configuration

Production-ready configurations for Nginx, HAProxy, and Traefik including SSL/TLS, load balancing, and security headers.

Available Ansible Snippets

Snippet Name Prefix Description
Ansible Full: add_host ansible-add_host-full Add a host (and group) with variables to the in-memory inventory.
Ansible Full: apt ansible-apt-full Manages apt-packages (Debian/Ubuntu) with more options.
Ansible Full: apt_key ansible-apt_key-full Add or remove an apt key with more options.
Ansible Full: apt_repository ansible-apt_repository-full Add and remove APT repositories with more options.
Ansible Full: assemble ansible-assemble-full Assemble configuration files from fragments with more options.
Ansible Full: assert ansible-assert-full Asserts given expressions are true with more options.
Ansible Full: async_status ansible-async_status-full Obtain status of asynchronous task with polling.
Ansible Full: blockinfile ansible-blockinfile-full Insert/update/remove a text block surrounded by marker lines with more options.
Ansible Full: command ansible-command-full Execute commands on targets with more options.
Ansible Full: copy ansible-copy-full Copy files to remote locations with more options.
Ansible Full: cron ansible-cron-full Manage cron.d and crontab entries with more options.
Ansible Full: deb822_repository ansible-deb822_repository-full Add and remove deb822 formatted repositories with more options.
Ansible Full: debconf ansible-debconf-full Configure a .deb package using debconf with more options.
Ansible Full: debug ansible-debug-full Print statements during execution with verbosity control.
Ansible Full: dnf ansible-dnf-full Manages packages with the DNF package manager with more options.
Ansible Full: dnf5 ansible-dnf5-full Manages packages with the dnf5 package manager with more options.
Ansible Full: dpkg_selections ansible-dpkg_selections-full Dpkg package selection selections (e.g., hold a package).
Ansible Full: expect ansible-expect-full Executes a command and responds to prompts with more options.
Ansible Full: fail ansible-fail-full Fail the playbook execution with a custom message and condition.
Ansible Full: fetch ansible-fetch-full Fetch files from remote nodes to the controller with more options.
Ansible Full: file ansible-file-full Manage files and file properties with more options.
Ansible Full: find ansible-find-full Return a list of files based on specific criteria with more options.
Ansible Full: gather_facts ansible-gather_facts-full Gathers facts about remote hosts explicitly with more options.
Ansible Full: get_url ansible-get_url-full Downloads files from HTTP, HTTPS, or FTP to node with more options.
Ansible Full: getent ansible-getent-full A wrapper to the unix getent utility with more options.
Ansible Full: git ansible-git-full Deploy software (or files) from git checkouts with more options.
Ansible Full: group ansible-group-full Add or remove groups with more options.
Ansible Full: group_by ansible-group_by-full Create Ansible groups based on facts or variables with more options.
Ansible Full: hostname ansible-hostname-full Manage system hostname with method selection.
Ansible Full: import_playbook ansible-import_playbook-full Import a playbook (statically) with variable passing.
Ansible Full: import_role ansible-import_role-full Import a role into a play (statically) with more options.
Ansible Full: import_tasks ansible-import_tasks-full Import a task list (statically) with variable passing.
Ansible Full: include_role ansible-include_role-full Load and execute a role (dynamically) with more options.
Ansible Full: include_tasks ansible-include_tasks-full Dynamically include a task list with more options.
Ansible Full: include_vars ansible-include_vars-full Load variables from files/directories, dynamically within a task, with more options.
Ansible Full: iptables ansible-iptables-full Modify iptables rules with more options.
Ansible Full: known_hosts ansible-known_hosts-full Add or remove a host from the known_hosts file with more options.
Ansible Full: lineinfile ansible-lineinfile-full Manage lines in text files with more options.
Ansible Full: meta ansible-meta-full Execute Ansible 'actions' to control playbook execution.
Ansible Full: mount_facts ansible-mount_facts-full Retrieve mount information about remote hosts.
Ansible Full: package ansible-package-full Generic OS package manager with backend selection.
Ansible Full: package_facts ansible-package_facts-full Package information as facts with manager selection.
Ansible Full: pause ansible-pause-full Pause playbook execution with timed options and prompt.
Ansible Full: ping ansible-ping-full Try to connect to host, verify a usable python and return 'pong' on success.
Ansible Full: pip ansible-pip-full Manages Python library dependencies with pip with more options.
Ansible Full: raw ansible-raw-full Executes a low-down and dirty command (bypasses module subsystem).
Ansible Full: reboot ansible-reboot-full Reboot a machine, with options for waiting and testing reconnection.
Ansible Full: replace ansible-replace-full Replace all instances of a string in a file using a back-referenced regular expression with more options.
Ansible Full: rpm_key ansible-rpm_key-full Adds or removes a GPG key from the RPM database with more options.
Ansible Full: script ansible-script-full Runs a local script on a remote node after transferring it, with more options.
Ansible Full: service ansible-service-full Manage services with more options.
Ansible Full: service_facts ansible-service_facts-full Return service state information as fact data.
Ansible Full: set_fact ansible-set_fact-full Set host variable(s) and fact(s) with more complex examples.
Ansible Full: set_stats ansible-set_stats-full Define and display stats for the current ansible run with more options.
Ansible Full: setup ansible-setup-full Gathers facts about remote hosts (often run implicitly) with more options.
Ansible Full: shell ansible-shell-full Execute shell commands on targets, allows pipes, redirects, etc., with more options.
Ansible Full: slurp ansible-slurp-full Slurps a file from remote nodes (content is base64 encoded).
Ansible Full: stat ansible-stat-full Retrieve file or file system status with more options.
Ansible Full: subversion ansible-subversion-full Deploys a subversion repository with more options.
Ansible Full: systemd_service ansible-systemd_service-full Manage systemd units with more options and states.
Ansible Full: sysvinit ansible-sysvinit-full Manage SysV services with more options.
Ansible Full: tempfile ansible-tempfile-full Creates temporary files and directories with more options.
Ansible Full: template ansible-template-full Template a file out to a target host using Jinja2 with more options.
Ansible Full: unarchive ansible-unarchive-full Unpacks an archive after (optionally) copying it from the local machine, with more options.
Ansible Full: uri ansible-uri-full Interacts with web services with comprehensive options.
Ansible Full: user ansible-user-full Manage user accounts with comprehensive options.
Ansible Full: validate_argument_spec (Role Meta) ansible-validate_argument_spec-full Validate role argument specs within meta/argument_specs.yml.
Ansible Full: wait_for ansible-wait_for-full Waits for a condition (port, path, regex) before continuing, with more options.
Ansible Full: wait_for_connection ansible-wait_for_connection-full Waits until remote system is reachable/usable via the connection plugin.
Ansible Full: yum_repository ansible-yum_repository-full Add or remove YUM/DNF repositories with comprehensive options.
Ansible Full: yum ansible-yum-full Manages packages with the YUM package manager (also DNF on newer systems) with comprehensive options.

Available Kubernetes Snippets

This extension includes comprehensive Kubernetes resource templates organized into several categories:

Core Kubernetes Resources

Snippet Name Prefix Description
Kubernetes Pod k8s-pod Kubernetes Pod template with common configurations
Kubernetes Deployment k8s-deployment Kubernetes Deployment template with scaling and update strategies
Kubernetes Service k8s-service Kubernetes Service template for exposing applications
Kubernetes ConfigMap k8s-configmap Kubernetes ConfigMap template for configuration data
Kubernetes Secret k8s-secret Kubernetes Secret template for sensitive data
Kubernetes Ingress k8s-ingress Kubernetes Ingress template for HTTP routing
Kubernetes PersistentVolumeClaim k8s-pvc Kubernetes PersistentVolumeClaim template
Kubernetes PersistentVolume k8s-pv Kubernetes PersistentVolume template
Kubernetes StatefulSet k8s-statefulset Kubernetes StatefulSet template for stateful applications
Kubernetes DaemonSet k8s-daemonset Kubernetes DaemonSet template for node-level services
Kubernetes Job k8s-job Kubernetes Job template for batch processing
Kubernetes CronJob k8s-cronjob Kubernetes CronJob template for scheduled tasks
Kubernetes Namespace k8s-namespace Kubernetes Namespace template
Kubernetes ResourceQuota k8s-resourcequota Kubernetes ResourceQuota template
Kubernetes LimitRange k8s-limitrange Kubernetes LimitRange template
Kubernetes HorizontalPodAutoscaler k8s-hpa Kubernetes HorizontalPodAutoscaler template
Kubernetes NetworkPolicy k8s-networkpolicy Kubernetes NetworkPolicy template
Kubernetes ServiceAccount k8s-serviceaccount Kubernetes ServiceAccount template
Kubernetes Role k8s-role Kubernetes Role template
Kubernetes RoleBinding k8s-rolebinding Kubernetes RoleBinding template
Kubernetes ClusterRole k8s-clusterrole Kubernetes ClusterRole template
Kubernetes ClusterRoleBinding k8s-clusterrolebinding Kubernetes ClusterRoleBinding template
Kubernetes Kustomization k8s-kustomization Kubernetes Kustomization template
Kubernetes CustomResourceDefinition k8s-crd Kubernetes CustomResourceDefinition template

Storage and Certificate Resources

Snippet Name Prefix Description
Kubernetes StorageClass k8s-storageclass Kubernetes StorageClass template
Kubernetes VolumeSnapshot k8s-volumesnapshot Kubernetes VolumeSnapshot template
Kubernetes VolumeSnapshotClass k8s-volumesnapshotclass Kubernetes VolumeSnapshotClass template
Kubernetes VolumeSnapshotContent k8s-volumesnapshotcontent Kubernetes VolumeSnapshotContent template
Kubernetes CSIDriver k8s-csidriver Kubernetes CSIDriver template
Kubernetes CSINode k8s-csinode Kubernetes CSINode template
Kubernetes Certificate k8s-cert-manager-certificate Kubernetes Certificate template (cert-manager)
Kubernetes Issuer k8s-cert-manager-issuer Kubernetes Issuer template (cert-manager)
Kubernetes ClusterIssuer k8s-cert-manager-clusterissuer Kubernetes ClusterIssuer template (cert-manager)
Kubernetes CertificateRequest k8s-cert-manager-certificaterequest Kubernetes CertificateRequest template (cert-manager)
Kubernetes Endpoints k8s-endpoints Kubernetes Endpoints template
Kubernetes EndpointSlice k8s-endpointslice Kubernetes EndpointSlice template

Istio Service Mesh Resources

Snippet Name Prefix Description
Kubernetes Istio VirtualService k8s-istio-virtualservice Kubernetes Istio VirtualService template
Kubernetes Istio Gateway k8s-istio-gateway Kubernetes Istio Gateway template
Kubernetes Istio DestinationRule k8s-istio-destinationrule Kubernetes Istio DestinationRule template
Kubernetes Istio ServiceEntry k8s-istio-serviceentry Kubernetes Istio ServiceEntry template
Kubernetes Istio EnvoyFilter k8s-istio-envoyfilter Kubernetes Istio EnvoyFilter template
Kubernetes Istio AuthorizationPolicy k8s-istio-authorizationpolicy Kubernetes Istio AuthorizationPolicy template
Kubernetes Istio PeerAuthentication k8s-istio-peerauthentication Kubernetes Istio PeerAuthentication template
Kubernetes Istio RequestAuthentication k8s-istio-requestauthentication Kubernetes Istio RequestAuthentication template
Kubernetes Istio Sidecar k8s-istio-sidecar Kubernetes Istio Sidecar template
Kubernetes Istio Telemetry k8s-istio-telemetry Kubernetes Istio Telemetry template

Prometheus Operator Resources

Snippet Name Prefix Description
Kubernetes Prometheus ServiceMonitor k8s-servicemonitor Kubernetes Prometheus ServiceMonitor template
Kubernetes Prometheus PrometheusRule k8s-prometheusrule Kubernetes Prometheus PrometheusRule template
Kubernetes Prometheus PodMonitor k8s-podmonitor Kubernetes Prometheus PodMonitor template
Kubernetes Prometheus k8s-prometheus Kubernetes Prometheus template
Kubernetes Alertmanager k8s-alertmanager Kubernetes Alertmanager template
Kubernetes AlertmanagerConfig k8s-alertmanagerconfig Kubernetes AlertmanagerConfig template
Kubernetes ThanosRuler k8s-thanosruler Kubernetes ThanosRuler template

GitOps Resources (ArgoCD and Flux)

Snippet Name Prefix Description
Kubernetes ArgoCD Application k8s-argocd-application Kubernetes ArgoCD Application template
Kubernetes ArgoCD AppProject k8s-argocd-project Kubernetes ArgoCD AppProject template
Kubernetes ArgoCD ApplicationSet k8s-argocd-applicationset Kubernetes ArgoCD ApplicationSet template
Kubernetes Flux GitRepository k8s-flux-gitrepository Kubernetes Flux GitRepository template
Kubernetes Flux Kustomization k8s-flux-kustomization Kubernetes Flux Kustomization template
Kubernetes Flux HelmRepository k8s-flux-helmrepository Kubernetes Flux HelmRepository template
Kubernetes Flux HelmRelease k8s-flux-helmrelease Kubernetes Flux HelmRelease template
Kubernetes Flux ImageRepository k8s-flux-imagerepository Kubernetes Flux ImageRepository template
Kubernetes Flux ImagePolicy k8s-flux-imagepolicy Kubernetes Flux ImagePolicy template
Kubernetes Flux ImageUpdateAutomation k8s-flux-imageupdateautomation Kubernetes Flux ImageUpdateAutomation template
Kubernetes Flux Alert k8s-flux-alert Kubernetes Flux Alert template
Kubernetes Flux Provider k8s-flux-provider Kubernetes Flux Provider template

Advanced Kubernetes Resources

Snippet Name Prefix Description
Kubernetes PodDisruptionBudget k8s-pdb Kubernetes PodDisruptionBudget template
Kubernetes PriorityClass k8s-priorityclass Kubernetes PriorityClass template
Kubernetes StorageClass k8s-storageclass Kubernetes StorageClass template
Kubernetes VolumeSnapshot k8s-volumesnapshot Kubernetes VolumeSnapshot template
Kubernetes VolumeSnapshotClass k8s-volumesnapshotclass Kubernetes VolumeSnapshotClass template
Kubernetes Endpoints k8s-endpoints Kubernetes Endpoints template
Kubernetes ValidatingWebhookConfig k8s-validatingwebhook Kubernetes ValidatingWebhookConfiguration template
Kubernetes MutatingWebhookConfig k8s-mutatingwebhook Kubernetes MutatingWebhookConfiguration template
Kubernetes CertificateSigningRequest k8s-csr Kubernetes CertificateSigningRequest template
Kubernetes Event k8s-event Kubernetes Event template
Kubernetes RuntimeClass k8s-runtimeclass Kubernetes RuntimeClass template
Kubernetes Helm Release k8s-helm-release Kubernetes Helm Release template (Flux CD)
Kubernetes Kustomize Patch k8s-kustomize-patch Kubernetes Kustomize patch template
Kubernetes ArgoCD Application k8s-argocd-application Kubernetes ArgoCD Application template
Kubernetes ArgoCD AppProject k8s-argocd-project Kubernetes ArgoCD AppProject template

Available Terraform Snippets

This extension includes 50+ comprehensive Terraform snippets covering AWS, Azure, and GCP resources:

Core Terraform Features

  • Providers (AWS, Azure, GCP)
  • Backend configurations (S3, Azure)
  • Variables, outputs, locals
  • Modules and data sources
  • Advanced patterns (for_each, count, dynamic blocks)
  • Validation and workspace management

AWS Resources

  • EC2 instances, VPCs, subnets, security groups
  • S3 buckets with security configurations
  • Lambda functions, RDS databases
  • Auto Scaling Groups, Load Balancers
  • EKS clusters, CloudWatch, IAM roles

Azure Resources

  • Virtual machines, virtual networks
  • AKS clusters, resource groups

GCP Resources

  • Compute instances, VPC networks, subnets
  • Firewall rules, Cloud NAT, load balancers
  • GKE clusters, Cloud Storage, Cloud SQL
  • Service accounts, Cloud Functions
  • DNS zones, Pub/Sub

Available Docker Snippets

Comprehensive Docker and Docker Compose templates:

Dockerfile Templates

  • Multi-stage builds for various languages (Node.js, Python, Go, Java)
  • Production-ready configurations
  • Security best practices

Docker Compose

  • Development environments
  • Production deployments with monitoring
  • Database services (PostgreSQL, MySQL, Redis)
  • Reverse proxy configurations

Available GitHub Actions Snippets

Ready-to-use CI/CD workflow templates:

Workflow Templates

  • Node.js, Python, Go, Java applications
  • Matrix builds for multiple versions
  • Security scanning and code quality
  • Docker build and deployment
  • Release automation

Deployment Patterns

  • AWS, Azure, GCP deployments
  • Kubernetes deployments
  • Terraform infrastructure provisioning

Available Jenkins Pipeline Snippets

Production-ready Jenkins pipeline templates:

Pipeline Types

  • Declarative and scripted pipelines
  • Multi-branch and parallel builds
  • Docker-based builds
  • Deployment pipelines

Integration Patterns

  • Git workflows, testing stages
  • Artifact management
  • Notification systems

Available Network Configuration Snippets

Production-ready network configurations:

Nginx

  • Basic server configurations
  • SSL/TLS setup with Let's Encrypt
  • Reverse proxy and load balancing
  • Rate limiting and caching
  • Security headers and gzip compression

HAProxy

  • Load balancer configurations
  • SSL termination and ACL rules
  • Health checks and sticky sessions
  • Rate limiting and statistics

Traefik

  • Dynamic configuration with Docker labels
  • Let's Encrypt integration
  • Middleware for security and compression
  • Kubernetes IngressRoute and CRDs

Contributing

We welcome contributions! Please feel free to submit issues, feature requests, or pull requests to help improve this extension.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft