{"id":19222950,"url":"https://github.com/pyratlabs/ansible-role-controller","last_synced_at":"2026-04-28T23:37:43.477Z","repository":{"id":69224769,"uuid":"219361777","full_name":"PyratLabs/ansible-role-controller","owner":"PyratLabs","description":"Ansible role to provision an Ansible Controller","archived":false,"fork":false,"pushed_at":"2021-01-01T20:21:10.000Z","size":52,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-14T23:57:52.759Z","etag":null,"topics":["ansible","ansible-controller","ansible-role","bootstrap","control-host","controller","infrastructure-as-code"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PyratLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-03T20:34:00.000Z","updated_at":"2022-04-01T15:59:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"74ea69af-7011-426b-a59c-4658b87556b4","html_url":"https://github.com/PyratLabs/ansible-role-controller","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/PyratLabs/ansible-role-controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyratLabs%2Fansible-role-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyratLabs%2Fansible-role-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyratLabs%2Fansible-role-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyratLabs%2Fansible-role-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PyratLabs","download_url":"https://codeload.github.com/PyratLabs/ansible-role-controller/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyratLabs%2Fansible-role-controller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32404340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-controller","ansible-role","bootstrap","control-host","controller","infrastructure-as-code"],"created_at":"2024-11-09T15:06:00.676Z","updated_at":"2026-04-28T23:37:43.461Z","avatar_url":"https://github.com/PyratLabs.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Role: controller\n\nAnsible role for installing an Ansible Controller into a Python3 VirtualEnv.\n\n[![Build Status](https://www.travis-ci.org/PyratLabs/ansible-role-controller.svg?branch=master)](https://www.travis-ci.org/PyratLabs/ansible-role-controller)\n\n## Requirements\n\nThis role requires an existing installation of Ansible. A temporary installation\ncan be created by running the following [bootstrap script](bootstrap.sh).\n\nThis role has been tested on Ansible 2.6.0+ against the following Linux Distributions:\n\n  - Amazon Linux 2\n  - CentOS 8\n  - CentOS 7\n  - Debian 10\n  - Fedora 29\n  - Fedora 30\n  - Fedora 31\n  - Ubuntu 18.04 LTS\n\n## Disclaimer\n\nIf you have any problems please create a GitHub issue, I maintain this role in\nmy spare time so I cannot promise a speedy fix delivery.\n\n## Role Variables\n\n\n| Variable                                    | Description                                                                 | Default Value               |\n|---------------------------------------------|-----------------------------------------------------------------------------|-----------------------------|\n| `controller_ansible_version`                | Use a specific version of Ansible, eg. `2.9.0`. Specify `false` for latest. | `false`                     |\n| `controller_ansible_support_packages`       | Install molecule support packages (eg. Azure)                               | []                          |\n| `controller_ansible_install_dir`            | Installation directory to put Ansible virtual environments.                 | `$HOME/.virtualenvs`        |\n| `controller_ansible_venv_name`              | Name for the Ansible Virtualenv.                                            | ansible                     |\n| `controller_ansible_venv_suffix`            | Add a custom suffix to virtualenv.                                          | `controller_ansible_version`|\n| `controller_ansible_venv_site_packages`     | Allow venv to inherit packages from global site-packages.                   | `false`                     |\n| `controller_ansible_install_venv_helper`    | Install a venv helper to launch venv executables from a \"bin\" directory.    | `true`                      |\n| `controller_ansible_bin_dir`                | \"bin\" directory to install venv-helpers to.                                 | `$HOME/bin`                 |\n| `controller_ansible_config_path`            | Path to the default ansible.cfg file to use.                                | `$HOME/.ansible.cfg`        |\n| `controller_ansible_inventory_path`         | Path to the default ansible inventory file.                                 | `$HOME/.ansible/hosts.yml`  |\n| `controller_ansible_projects_dir`           | Directory to put Ansible projects.                                          | `$HOME/projects`            |\n| `controller_ansible_roles_dir`              | Directory to install Ansible Galaxy roles to.                               | `$HOME/.ansible/roles`      |\n| `controller_install_os_dependencies`        | Allow role to install OS dependencies.                                      | `false`                     |\n| `controller_python3_path`                   | Specify a path to a specific python version to use in virtualenv.           | _NULL_                      |\n| `controller_ansible_galaxy_roles`           | List of Ansible roles to be installed with `ansible-galaxy`. See notes.     | _NULL_                      |\n| `controller_ansible_projects`               | List of Ansible projects to be cloned with `git`. See notes.                | _NULL_                      |\n| `controller_ansible_projects_install_roles` | Install Ansible roles defined in project requirements.yml file. (boolean)   | `false`                     |\n\n## Dependencies\n\nNo dependencies on other roles.\n\n## Example Playbook\n\nExample playbook for installing to single user:\n\n```yaml\n- hosts: control_hosts\n  roles:\n     - { role: xanmanning.controller, controller_ansible_version: 2.6.5 }\n```\n\nExample playbook for installing the latest Ansible version globally:\n\n```yaml\n---\n- hosts: control_hosts\n  become: true\n  vars:\n    controller_install_os_dependencies: true\n    controller_ansible_install_dir: /opt/ansible/bin\n    controller_ansible_config_path: /etc/ansible/ansible.cfg\n    controller_ansible_inventory_path: /etc/ansible/hosts\n    controller_ansible_projects_dir: /opt/ansible/projects\n    controller_ansible_roles_dir: /opt/ansible/roles\n    controller_ansible_bin_dir: /usr/bin\n    controller_ansible_venv_name: current\n    controller_ansible_support_packages:\n      - azure\n    controller_ansible_galaxy_roles:\n      - name: controller\n        src: xanmanning.controller\n      - name: git\n        src: https://github.com/geerlingguy/ansible-role-git\n        scm: git\n        version: 2.1.0\n  roles:\n    - role: xanmanning.controller\n```\n\n### Activating the Ansible venv\n\nOnce logged into the controller, you need to activate the python3 virtual\nenvironment to be able to access Ansible. This is done as per the below:\n\n```bash\nsource {{ controller_ansible_install_dir }}/{{ controller_ansible_venv_name }}/bin/activate\n```\n\nIn the above example global installation playbook, this would look like the\nfollowing:\n\n```bash\nsource /opt/ansible/bin/current/bin/activate\n```\n\n### Note about `controller_ansible_galaxy_roles`\n\nThis is a list of Ansible roles to be installed using `ansible-galaxy`. This\nvariable needs to be structured as per the below example:\n\n```yaml\ncontroller_ansible_galaxy_roles:\n  # Install the latest xanmanning.k3s role\n  - src: xanmanning.k3s\n\n  # Install the latest xanmanning.controller role as \"controller\"\n  - name: controller\n    src: xanmanning.controller\n\n  # Install geerlingguy.jenkins version 3.8.1 from github as \"jenkins\"\n  - name: jenkins\n    src: https://github.com/geerlingguy/ansible-role-jenkins\n    scm: git\n    version: 3.8.1\n```\n\n### Note about `controller_ansible_projects`\n\nThis is a list of git repositories to be cloned into the projects directory.\nIf this is empty, no projects will be cloned.\n\nBelow is an example of a project:\n\n```yaml\ncontroller_ansible_projects:\n    - name: mac-dev-workstation                           # Directory name to clone into\n      repo: git@github.com:geerlingguy/mac-dev-playbook   # Repository to clone\n      update_repo: true                                   # Always update local copy of repo\n      version:  master                                    # Check out this version of the repo\n      force: false                                        # Discard any existing working copy of the repo\n      key_file: \"{{ ansible_user_dir }}/.ssh/id_rsa\"      # Key file to use to clone the repo\n      recursive: true                                     # Include submodules in clone\n```\n\n## License\n\n[BSD 3-clause](LICENSE.txt)\n\n## Author Information\n\n[Xan Manning](https://xanmanning.co.uk/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyratlabs%2Fansible-role-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyratlabs%2Fansible-role-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyratlabs%2Fansible-role-controller/lists"}