{"id":25072466,"url":"https://github.com/upcloudltd/upcloud-ansible-collection","last_synced_at":"2025-04-14T22:02:35.369Z","repository":{"id":51231051,"uuid":"365211394","full_name":"UpCloudLtd/upcloud-ansible-collection","owner":"UpCloudLtd","description":"Ansible UpCloud Collection module","archived":false,"fork":false,"pushed_at":"2024-10-17T12:11:38.000Z","size":39,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":12,"default_branch":"main","last_synced_at":"2024-10-19T12:46:40.771Z","etag":null,"topics":["ansible-collection","ansible-inventory-plugin","upcloud","upcloud-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UpCloudLtd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-07T11:27:31.000Z","updated_at":"2024-10-17T12:11:39.000Z","dependencies_parsed_at":"2022-08-12T23:00:24.712Z","dependency_job_id":"e0b3ee13-f582-4df4-9eb3-2669edb174e0","html_url":"https://github.com/UpCloudLtd/upcloud-ansible-collection","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpCloudLtd%2Fupcloud-ansible-collection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpCloudLtd%2Fupcloud-ansible-collection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpCloudLtd%2Fupcloud-ansible-collection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpCloudLtd%2Fupcloud-ansible-collection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UpCloudLtd","download_url":"https://codeload.github.com/UpCloudLtd/upcloud-ansible-collection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968741,"owners_count":21191158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-collection","ansible-inventory-plugin","upcloud","upcloud-api"],"created_at":"2025-02-06T22:29:25.473Z","updated_at":"2025-04-14T22:02:35.340Z","avatar_url":"https://github.com/UpCloudLtd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible UpCloud Collection\n\n\n[![Ansible sanity tests](https://github.com/UpCloudLtd/upcloud-ansible-collection/actions/workflows/sanity-test.yml/badge.svg)](https://github.com/UpCloudLtd/upcloud-ansible-collection/actions/workflows/sanity-test.yml)\n[![unit tests](https://github.com/UpCloudLtd/upcloud-ansible-collection/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/UpCloudLtd/upcloud-ansible-collection/actions/workflows/unit-tests.yml)\n\nUpCloud inventory as a modernized Ansible collection. Current scope only covers UpCloud's servers offering,\nbut depending on the demand we might include our other services (networks, (object) storages, routers, databases etc)\nin it as well. Same goes for plugins for other API actions. We recommend using\n[Terraform](https://upcloud.com/community/tutorials/get-started-terraform/) for automated management of your UpCloud\ninfrastructure, but we might implement some server control plugins for Ansible in the future if the demand is there.\n\nIf you find yourself needing a specific service as an inventory, please open an\n[issue](https://github.com/UpCloudLtd/upcloud-ansible-collection/issues). Please see the development \u0026 contribution\nsections below for development quickstart if you're interested in adding new features or making fixes.\n\n## Getting Started\n\n### Prerequisites\n\nUpCloud Collection requires [UpCloud API's Python bindings](https://pypi.org/project/upcloud-api/) version 2.5.0 or\nnewer in order to work. It can be installed from the Python Package Index with the `pip` tool:\n\n```bash\npip3 install upcloud-api\u003e=2.5.0\n```\n\nThe collection itself can be installed with the `ansible-galaxy` command that comes with the Ansible package:\n\n```bash\nansible-galaxy collection install https://github.com/UpCloudLtd/upcloud-ansible-collection/releases/download/v0.6.0/community-upcloud-0.6.0.tar.gz\n```\n\n### Inventory usage\n\nInventory file must be named so that it ends either in `upcloud.yml` or `upcloud.yaml`. It is also possible to filter\nservers based on their zone, tags, state, or the network they belong to.\n\n#### Quick Start\n\nCreate an `upcloud.yml` file with these contents:\n\n```yaml\nplugin: community.upcloud.upcloud\n```\n\nSet environment variables for API authentication:\n\n```bash\nexport UPCLOUD_USERNAME=\"upcloud-api-access-enabled-user\"\nexport UPCLOUD_PASSWORD=\"verysecretpassword\"\n```\n\nAnd show the Ansible inventory information as a graph:\n\n```bash\nansible-inventory -i upcloud.yml --graph --vars\n```\n\nYou should see a list of hosts and their host variables you can use in playbooks.\n\n#### Further examples\n\nYou can filter based on multiple data points:\n\n```yaml\nplugin: community.upcloud.upcloud\nzones:\n  - fi-hel2\nlabels:\n  - role=prod\n  - foo\nstates:\n  - started\nconnect_with: private_ipv4\nnetwork: 035a0a8a-7704-4da5-820d-129fc8232714\nserver_group: Group name or UUID\n```\n\nServers can also be grouped by status, zone etc by specifying them as `keyed_groups`.\n\n```yaml\nplugin: community.upcloud.upcloud\nkeyed_groups:\n  - key: zone\n    prefix: upcloud_zone\n  - key: state\n    prefix: server_state\n```\n\nExamples here assume that API credentials are available as environment variables\n(`UPCLOUD_USERNAME` \u0026 `UPCLOUD_PASSWORD`). They can also be defined in inventory file:\n\n```yaml\nplugin: community.upcloud.upcloud\nusername: YOUR_USERNAME\npassword: YOUR_PASSWORD\n```\n\n## Troubleshooting\n\nIf you are having problems loading, finding or enabling the collection, you might need to create or modify your\nexisting `ansible.cfg`config. Adding the following settings should ensure that the collection can be found and is\nenabled:\n\n```\n[default]\ncollections_paths = ~/.ansible/collections:/usr/share/ansible/collections\n\n[inventory]\nenable_plugins = community.upcloud.upcloud\n```\n\nNote that, if you are using any other plugins, those should be listed in `enable_plugins` as well.\n\n## Changelog\n\nChangelog is available [in its own file](CHANGELOG.md).\n\n## Development\n\nThis collection follows [Ansible Developer Guide](https://docs.ansible.com/ansible/devel/dev_guide/index.html), with\nthe exception that Python 2.7 is not supported as the support has been dropped from UpCloud's Python SDK.\n\nAll functionality should include [relevant tests](https://docs.ansible.com/ansible/latest/dev_guide/testing.html).\n\nTests can be run with `ansible-test` tool (comes with Ansible) in the collection folder (default:\n~/.ansible/collections/ansible_collections/community/upcloud):\n\n```bash\n$ cd ~/.ansible/collections/ansible_collections/community/upcloud\n$ ansible-test sanity --docker -v --color\n...\n$ ansible-test units -v --color --docker --coverage\n...\n```\n\n### Building and installing a new version locally\n\nA new version can be built and tested locally with the `ansible-galaxy` tool that is packaged with Ansible.\n\n```bash\nansible-galaxy collection build\nansible-galaxy collection install community-upcloud-\u003cVERSION\u003e.tar.gz\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupcloudltd%2Fupcloud-ansible-collection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fupcloudltd%2Fupcloud-ansible-collection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupcloudltd%2Fupcloud-ansible-collection/lists"}