Skip to content

Commit 0cd2880

Browse files
authored
feat!: rename collection to upcloud.cloud and inventory plugin to servers (#20)
1 parent 8cb0a44 commit 0cd2880

17 files changed

Lines changed: 54 additions & 45 deletions

File tree

.github/workflows/build-and-release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ on:
55
- "v*"
66

77
env:
8-
NAMESPACE: community
9-
COLLECTION_NAME: upcloud
10-
ANSIBLE_VERSION: stable-2.15
8+
NAMESPACE: upcloud
9+
COLLECTION_NAME: cloud
10+
ANSIBLE_VERSION: stable-2.18
1111

1212
jobs:
1313
units:
@@ -30,9 +30,14 @@ jobs:
3030
run: mkdir release && ansible-galaxy collection build --output-path release/
3131

3232
- name: Create new release
33-
uses: ncipollo/release-action@v1
33+
uses: ncipollo/release-action@v1.16.0
3434
with:
3535
token: ${{ secrets.GITHUB_TOKEN }}
3636
draft: false
3737
prerelease: false
3838
artifacts: "release/${{env.NAMESPACE}}-${{env.COLLECTION_NAME}}*.tar.gz"
39+
40+
- name: Upload release to Ansible Galaxy
41+
uses: artis3n/ansible_galaxy_collection@v2.11.0
42+
with:
43+
api_key: ${{ secrets.GALAXY_TOKEN }}

.github/workflows/sanity-test.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@ on:
44
branches:
55
- main
66
pull_request:
7+
78
env:
8-
NAMESPACE: community
9-
COLLECTION_NAME: upcloud
9+
NAMESPACE: upcloud
10+
COLLECTION_NAME: cloud
1011

1112
jobs:
1213
sanity:
1314
name: Sanity test (${{ matrix.version.ansible }})
1415
strategy:
1516
matrix:
1617
version:
17-
- { ansible: stable-2.13, python: "3.10" }
18-
- { ansible: stable-2.14, python: "3.11" }
19-
- { ansible: stable-2.15, python: "3.11" }
18+
- { ansible: stable-2.16, python: "3.11" }
19+
- { ansible: stable-2.17, python: "3.11" }
20+
- { ansible: stable-2.18, python: "3.11" }
2021
- { ansible: devel, python: "3.11" }
2122
runs-on: ubuntu-latest
2223
steps:

.github/workflows/unit-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66
pull_request:
77

88
env:
9-
NAMESPACE: community
10-
COLLECTION_NAME: upcloud
9+
NAMESPACE: upcloud
10+
COLLECTION_NAME: cloud
1111

1212
jobs:
1313
units:
@@ -17,9 +17,9 @@ jobs:
1717
fail-fast: true
1818
matrix:
1919
version:
20-
- { ansible: stable-2.13, python: "3.10" }
21-
- { ansible: stable-2.14, python: "3.11" }
22-
- { ansible: stable-2.15, python: "3.11" }
20+
- { ansible: stable-2.16, python: "3.11" }
21+
- { ansible: stable-2.17, python: "3.11" }
22+
- { ansible: stable-2.18, python: "3.11" }
2323
- { ansible: devel, python: "3.11" }
2424

2525
steps:

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
---
10+
### Changed
11+
12+
- **Breaking**: Rename collection to `upcloud.cloud` to enable releasing to Ansible Galaxy.
13+
- **Breaking**: Rename inventory plugin to `servers`.
1114

1215
## [0.6.0] - 2023-09-25
1316

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
UpCloud inventory as a modernized Ansible collection. Current scope only covers UpCloud's servers offering,
88
but depending on the demand we might include our other services (networks, (object) storages, routers, databases etc)
99
in it as well. Same goes for plugins for other API actions. We recommend using
10-
[Terraform](https://upcloud.com/community/tutorials/get-started-terraform/) for automated management of your UpCloud
10+
[Terraform](https://upcloud.com/docs/guides/get-started-terraform/) for automated management of your UpCloud
1111
infrastructure, but we might implement some server control plugins for Ansible in the future if the demand is there.
1212

1313
If you find yourself needing a specific service as an inventory, please open an
@@ -41,7 +41,7 @@ servers based on their zone, tags, state, or the network they belong to.
4141
Create an `upcloud.yml` file with these contents:
4242

4343
```yaml
44-
plugin: community.upcloud.upcloud
44+
plugin: upcloud.cloud.servers
4545
```
4646
4747
Set environment variables for API authentication:
@@ -64,7 +64,7 @@ You should see a list of hosts and their host variables you can use in playbooks
6464
You can filter based on multiple data points:
6565

6666
```yaml
67-
plugin: community.upcloud.upcloud
67+
plugin: upcloud.cloud.servers
6868
zones:
6969
- fi-hel2
7070
labels:
@@ -80,7 +80,7 @@ server_group: Group name or UUID
8080
Servers can also be grouped by status, zone etc by specifying them as `keyed_groups`.
8181

8282
```yaml
83-
plugin: community.upcloud.upcloud
83+
plugin: upcloud.cloud.servers
8484
keyed_groups:
8585
- key: zone
8686
prefix: upcloud_zone
@@ -92,7 +92,7 @@ Examples here assume that API credentials are available as environment variables
9292
(`UPCLOUD_USERNAME` & `UPCLOUD_PASSWORD`). They can also be defined in inventory file:
9393

9494
```yaml
95-
plugin: community.upcloud.upcloud
95+
plugin: upcloud.cloud.servers
9696
username: YOUR_USERNAME
9797
password: YOUR_PASSWORD
9898
```
@@ -108,7 +108,7 @@ enabled:
108108
collections_paths = ~/.ansible/collections:/usr/share/ansible/collections
109109
110110
[inventory]
111-
enable_plugins = community.upcloud.upcloud
111+
enable_plugins = upcloud.cloud.servers
112112
```
113113

114114
Note that, if you are using any other plugins, those should be listed in `enable_plugins` as well.

examples/inventory-rolling-update/ansible.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ host_key_checking = False
33
inventory = ./inventory.upcloud.yml
44

55
[inventory]
6-
enable_plugins = community.upcloud.upcloud
6+
enable_plugins = upcloud.cloud.servers
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
plugin: community.upcloud.upcloud
1+
plugin: upcloud.cloud.servers
22
server_group: ansible-inventory-example-servergroup

galaxy.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
namespace: community
2-
name: upcloud
3-
version: 0.6.0
1+
namespace: upcloud
2+
name: cloud
3+
version: 0.7.0
44
readme: README.md
55
authors:
66
- UpCloud developers (github.com/UpCloudLtd)
77
description: A collection for managing UpCloud resources & inventory
8-
license: MIT
8+
license:
9+
- MIT
910
license_file: 'LICENSE'
1011
tags:
1112
- upcloud
1213
- cloud
1314

1415
repository: https://github.com/UpCloudLtd/upcloud-ansible-collection
15-
documentation: TODO
16+
documentation: https://github.com/UpCloudLtd/upcloud-ansible-collection
1617
homepage: https://github.com/UpCloudLtd/upcloud-ansible-collection
1718
issues: https://github.com/UpCloudLtd/upcloud-ansible-collection/issues
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
__metaclass__ = type
22

33
DOCUMENTATION = r'''
4-
name: upcloud
4+
name: servers
55
author:
66
- Antti Myyrä (@ajmyyra)
7-
short_description: Ansible dynamic inventory plugin for UpCloud.
7+
- UpCloud (@UpCloudLtd)
8+
short_description: Ansible dynamic inventory plugin for UpCloud servers.
89
requirements:
910
- python >= 3.7
1011
- upcloud-api >= 2.5.0
@@ -17,7 +18,7 @@
1718
plugin:
1819
description: The name of the UpCloud Ansible inventory plugin
1920
required: true
20-
choices: ["community.upcloud.upcloud"]
21+
choices: ["upcloud.cloud.servers"]
2122
username:
2223
description: UpCloud API username.
2324
required: false
@@ -82,10 +83,10 @@
8283

8384
EXAMPLES = r"""
8485
# Minimal example. `UPCLOUD_USERNAME` and `UPCLOUD_PASSWORD` are available as environment variables.
85-
plugin: community.upcloud.upcloud
86+
plugin: upcloud.cloud.servers
8687
8788
# Example with username and password
88-
plugin: community.upcloud.upcloud
89+
plugin: upcloud.cloud.servers
8990
username: YOUR_USERNAME
9091
password: YOUR_PASSWORD
9192
zones:
@@ -95,7 +96,7 @@
9596
- foo
9697
9798
# Example with locations, labels and server_group
98-
plugin: community.upcloud.upcloud
99+
plugin: upcloud.cloud.servers
99100
zones:
100101
- es-mad1
101102
- fi-hel2
@@ -106,7 +107,7 @@
106107
107108
# Group by a zone with prefix e.g. "upcloud_zone_us-nyc1"
108109
# and state with prefix e.g. "server_state_running"
109-
plugin: community.upcloud.upcloud
110+
plugin: upcloud.cloud.servers
110111
keyed_groups:
111112
- key: zone
112113
prefix: upcloud_zone

tests/sanity/ignore-2.13.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)