此内容没有您所选择的语言版本。

Chapter 1. Set up your development environment with the MCP server-enabled Ansible VS Code extension


Use the MCP server-enabled Ansible AI assistant within the Ansible VS Code extension to:

  • Query your environment to understand which tools are already installed.
  • Install ansible-dev-tools.
  • Set up and configure your development environment.

1.1. Prerequisites

  • The latest version of Python is installed.

1.2. Run environment diagnostics

Use the AI assistant to assess your local environment to understand what tools, versions, and collections are currently installed.

Procedure

  1. Open GitHub Copilot chat.
  2. Enter a prompt in natural language asking the AI assistant what is installed in your environment. For example:

    1. Check my Ansible environment and tell me what’s installed.
    2. What collections are installed?

      The assistant then triggers the ade_environment_info tool.

  3. Review the output, which typically includes:

    1. Workspace path and Python version
    2. Virtual environment status
    3. Ansible Automation Platform and ansible_lint versions
    4. A list of installed collections
    5. The installation status of Ansible development tools (ADT).

If you do not have Ansible development tools (ADT) installed, you can instruct the AI assistant to install them.

Procedure

  1. Open GitHub Copilot chat.
  2. Enter the prompt: Make sure I have ansible-dev-tools installed.

    The system then checks if Ansible development tools is installed. If so, the assistant will report that ansible-dev-tools is installed. If Ansible development tools is not installed, the AI assistant chooses a package manager (pip or pipx) and installs ADT automatically.

Verification

When installation is complete, the AI assistant will return a message in the Copilot chat window confirming that ADT has been installed successfully. You can also prompt the AI assistant to check my Ansible environment again. If the installation was successful, the AI assistant will verify that ADT is installed in your environment.

After installing Ansible development tools, you can use the MCP server-enabled AI assistant in the Ansible VS Code extension to configure your workspace, including:

  • Setting up a virtual environment.
  • Installing specific Python versions.
  • Adding Ansible collections.

Procedure

  1. Open GitHub Copilot chat.
  2. In the chat window, enter a natural language prompt instructing the AI assistant to set up the configuration you want. For example:

    Set up a complete Ansible development environment with Python 3.11, and install the collections amazon.aws and ansible.posix.

    The assistant triggers the ade_setup_environment tool, and the system automatically performs the following configuration steps:

    • Create a virtual environment: The assistant creates a virtual environment (venv/) in your workspace.
    • Install core tools: The assistant installs ansible-core and ansible-lint in the new virtual environment.
    • Install collections: The assistant installs the requested collections (amazon.aws, ansible.posix) and their dependencies.
    • Check for conflicts: The assistant checks for conflicting packages and verifies ansible-lint status.
  3. Review the output in the Copilot chat. When setup is complete, the assistant confirms that the environment is set up, and gives instructions on activating the environment. For example:

    1. To activate, run source <path>/venv/bin/activate
    2. To deactivate, run deactivate.

Verification

Verify that configuration was successful by asking the AI assistant to check the environment status again. For example:

Check my environment again to confirm that everything is set up correctly.

The ade_environment_info tool runs and confirms the Python version, virtual environment path, and installed collections in its output.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部