Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable ansible.executionEnvironment.enabled in devcontainer files #322

Open
jeffcpullen opened this issue Nov 11, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@jeffcpullen
Copy link

jeffcpullen commented Nov 11, 2024

ISSUE TYPE
  • Feature Idea
SUMMARY

If a user is developing in a devcontainer they should have all the necessary Ansible Development Tools "local" in their terminal and do not need to launch tools inside the execution environment. When ansible.executionEnvironment.enabled is set to true a container is launched everytime a file is opened or saved to run ansible-lint. While this works, it makes things slow. This can be disabled as part of the devcontainer file to improve the user experience while developing.

{
  "name": "ansible-dev-container-podman",
  "image": "ghcr.io/ansible/community-ansible-dev-tools:latest",
  "containerUser": "root",
  "runArgs": [
    "--cap-add=SYS_ADMIN",
    "--cap-add=SYS_RESOURCE",
    // The following line stops the ansible-config mknod /dev/null errors
    // "--cap-add=CAP_MKNOD",
    "--device",
    "/dev/fuse",
    "--security-opt",
    "seccomp=unconfined",
    "--security-opt",
    "label=disable",
    "--security-opt",
    "apparmor=unconfined",
    "--userns=host",
    "--hostname=ansible-dev-container",
    "--volume",
    "ansible-dev-tools-container-storage:/var/lib/containers",
  ],
  "customizations": {
    "vscode": {
      "extensions": ["redhat.ansible", "redhat.vscode-redhat-account"],
      "settings": {
        "ansible.executionEnvironment.enabled": false
      }
    }
  }
}

Testing the automation code with the execution environment can be accomplished using ansible-navigator.

@jeffcpullen jeffcpullen added enhancement New feature or request new New issues and PRs to triaged labels Nov 11, 2024
@audgirka audgirka removed the new New issues and PRs to triaged label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants