Skip to main content

ansible-workspace

Create a workspace for multiple tools to easier develop ansible playbooks with roles.

Roles with a reference to a git repository will be cloned, checked out and added to the workspace.

The .gitignore will be configured to ignore the role repositories or symlinks.

Install

pip install -U ansible-workspace

or with pipx

pipx install ansible-workspace

Workspaces

ansible-workspace --help

General

If you want your roles in e.g. ~/ansible-roles but want to symlink them to ./roles use the following command:

ansible-workspace <tool> --roles-path ~/ansible-roles --symlink-path roles/

VSCode

The workspace consists of:

  • A folder for the playbook directory
  • A folder for each role defined in the requirements
ansible-workspace vscode

VSCode Workspace

code ~/workspaces/example-project.code-workspace

tmuxp

The workspace consists of:

  • A window for the playbook directory
  • A window to exectute ansible commands
  • A window for each role defined in the requirements
ansible-workspace tmuxp
tmuxp load -y ~/workspaces/example-project.tmuxp-workspace.yml

Tmuxp Workspace

Examples

The following roles are defined under roles/requirements.yml:

---
roles:
  - name: role1
    version: v1.0.3
    src: git@github.com:rwxd/ansible-role-subuid_subgid.git
    scm: git

  - name: role2
    version: v1.0.2
    src: git@github.com:rwxd/ansible-role-subuid_subgid.git
    scm: git

  - name: role3
    version: master
    src: git@github.com:rwxd/ansible-role-subuid_subgid.git
    scm: git
❯ ansible-workspace vscode
Cloning "git@github.com:rwxd/ansible-role-subuid_subgid.git" to "/tmp/test_repo/roles/role1"
Checking out "v1.0.3" on "git@github.com:rwxd/ansible-role-subuid_subgid.git"
Cloning "git@github.com:rwxd/ansible-role-subuid_subgid.git" to "/tmp/test_repo/roles/role2"
Checking out "v1.0.2" on "git@github.com:rwxd/ansible-role-subuid_subgid.git"
Cloning "git@github.com:rwxd/ansible-role-subuid_subgid.git" to "/tmp/test_repo/roles/role3"
Adding "roles/role1" to .gitignore
Adding "roles/role2" to .gitignore
Adding "roles/role3" to .gitignore
Created workspace config at "/home/<name>/workspaces/test_repo.code-workspace"

The workspace can now be opened with code ~/workspaces/test_repo.code-workspace.

Metadata

Release files for ansible-workspace 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ansible-workspace 1.0.9
File Size Uploaded Provenance Actions
ansible_workspace-1.0.9.tar.gz 7.0 kB Without provenance Details for ansible_workspace-1.0.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ansible-workspace 1.0.9
File Interpreter ABI Platform Actions
ansible_workspace-1.0.9-py3-none-any.whl Python 3 none any Details for ansible_workspace-1.0.9-py3-none-any.whl

Total release size: 15.2 kB

Release files / ansible_workspace-1.0.9.tar.gz

Download URL ansible_workspace-1.0.9.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
69530f413ede0a108bfa6ef5b17541572adff8c0e5670029e6f5736ef250c56f
BLAKE2b-256 checksum
How to use checksums
11fde53765f219fbc6b1478e9e72fc39e4402a05329d9651d2f3e6639a230921
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / ansible_workspace-1.0.9-py3-none-any.whl

Download URL ansible_workspace-1.0.9-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7f3b8fdee2f296ac49b5f76a83fb61107c3ecbf02095372d7b345a4e948af5f
BLAKE2b-256 checksum
How to use checksums
fff9511b69148d7524b0795fddb86d9ea4861d43b54df3c3aeb6dac7af576681
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for ansible-workspace 1.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page