Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Ansible Module SnippetNew to Visual Studio Code? Get it now.
Ansible Module Snippet

Ansible Module Snippet

pangestugalih

|
1 install
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

ansible-module-snippet README

This extension provides a collection of useful Ansible snippets to speed up your playbook development.

Features

This extension offers a comprehensive set of snippets for various Ansible modules and common tasks. Snippets are available in two flavors: "Full" (with all common parameters) and "Simple" (a more concise version).

Available 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.
Ansible: add_host ansible-add_host-simple Add a host to the in-memory inventory.
Ansible: apt ansible-apt-simple Manages apt-packages (Debian/Ubuntu).
Ansible: apt_key ansible-apt_key-simple Add or remove an apt key.
Ansible: apt_repository ansible-apt_repository-simple Add and remove APT repositories.
Ansible: assemble ansible-assemble-simple Assemble configuration files from fragments.
Ansible: assert ansible-assert-simple Asserts given expressions are true.
Ansible: async_status ansible-async_status-simple Obtain status of asynchronous task.
Ansible: blockinfile ansible-blockinfile-simple Insert/update/remove a text block.
Ansible: command ansible-command-simple Execute commands on targets.
Ansible: copy ansible-copy-simple Copy files to remote locations.
Ansible: cron ansible-cron-simple Manage cron.d and crontab entries.
Ansible: deb822_repository ansible-deb822_repository-simple Add and remove deb822 formatted repositories.
Ansible: debconf ansible-debconf-simple Configure a .deb package.
Ansible: debug ansible-debug-simple Print statements during execution.
Ansible: dnf ansible-dnf-simple Manages packages with the dnf package manager.
Ansible: dnf5 ansible-dnf5-simple Manages packages with the dnf5 package manager.
Ansible: dpkg_selections ansible-dpkg_selections-simple Dpkg package selection selections.
Ansible: expect ansible-expect-simple Executes a command and responds to prompts.
Ansible: fail ansible-fail-simple Fail with custom message.
Ansible: fetch ansible-fetch-simple Fetch files from remote nodes.
Ansible: file ansible-file-simple Manage files and file properties.
Ansible: find ansible-find-simple Return a list of files based on specific criteria.
Ansible: gather_facts ansible-gather_facts-simple Gathers facts about remote hosts explicitly.
Ansible: get_url ansible-get_url-simple Downloads files from HTTP, HTTPS, or FTP to node.
Ansible: getent ansible-getent-simple A wrapper to the unix getent utility.
Ansible: git ansible-git-simple Deploy software (or files) from git checkouts.
Ansible: group ansible-group-simple Add or remove groups.
Ansible: group_by ansible-group_by-simple Create Ansible groups based on facts.
Ansible: hostname ansible-hostname-simple Manage hostname.
Ansible: import_playbook ansible-import_playbook-simple Import a playbook (statically).
Ansible: import_role ansible-import_role-simple Import a role into a play (statically).
Ansible: import_tasks ansible-import_tasks-simple Import a task list (statically).
Ansible: include_role ansible-include_role-simple Load and execute a role (dynamically).
Ansible: include_tasks ansible-include_tasks-simple Dynamically include a task list.
Ansible: include_vars ansible-include_vars-simple Load variables from files, dynamically within a task.
Ansible: iptables ansible-iptables-simple Modify iptables rules.
Ansible: known_hosts ansible-known_hosts-simple Add or remove a host from the known_hosts file.
Ansible: lineinfile ansible-lineinfile-simple Manage lines in text files.
Ansible: meta ansible-meta-simple Execute Ansible 'actions' (e.g., flush_handlers, end_play).
Ansible: mount_facts ansible-mount_facts-simple Retrieve mount information.
Ansible: package ansible-package-simple Generic OS package manager.
Ansible: package_facts ansible-package_facts-simple Package information as facts.
Ansible: pause ansible-pause-simple Pause playbook execution.
Ansible: ping ansible-ping-simple Try to connect to host and verify Python.
Ansible: pip ansible-pip-simple Manages Python library dependencies.
Ansible: raw ansible-raw-simple Executes a low-down and dirty command.
Ansible: reboot ansible-reboot-simple Reboot a machine.
Ansible: replace ansible-replace-simple Replace all instances of a string in a file.
Ansible: rpm_key ansible-rpm_key-simple Adds or removes a GPG key from the RPM DB.
Ansible: script ansible-script-simple Runs a local script on a remote node.
Ansible: service ansible-service-simple Manage services.
Ansible: service_facts ansible-service_facts-simple Return service state information as fact data.
Ansible: set_fact ansible-set_fact-simple Set host variable(s) and fact(s).
Ansible: set_stats ansible-set_stats-simple Define and display stats for the current Ansible run.
Ansible: setup ansible-setup-simple Gathers facts about remote hosts (often implicit).
Ansible: shell ansible-shell-simple Execute shell commands on targets.
Ansible: slurp ansible-slurp-simple Slurps a file from remote nodes (base64 encoded).
Ansible: stat ansible-stat-simple Retrieve file or file system status.
Ansible: subversion ansible-subversion-simple Deploys a subversion repository.
Ansible: systemd_service ansible-systemd_service-simple Manage systemd units.
Ansible: sysvinit ansible-sysvinit-simple Manage SysV services.
Ansible: tempfile ansible-tempfile-simple Creates temporary files and directories.
Ansible: template ansible-template-simple Template a file out to a target host.
Ansible: unarchive ansible-unarchive-simple Unpacks an archive.
Ansible: uri ansible-uri-simple Interacts with web services.
Ansible: user ansible-user-simple Manage user accounts.
Ansible: validate_argument_spec ansible-validate_argument_spec-simple Validate role argument specs (used within meta/argument_specs.yml usually).
Ansible: wait_for ansible-wait_for-simple Waits for a condition before continuing.
Ansible: wait_for_connection ansible-wait_for_connection-simple Waits until remote system is reachable/usable.
Ansible: yum_repository ansible-yum_repository-simple Add or remove YUM repositories.
Ansible: yum ansible-yum-simple Manages packages with the yum package manager.

Enjoy!

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