Skip to content

Commit 2e0270c

Browse files
Merge pull request #655 from linode/dev
Release v0.36.0
2 parents d5a168a + 5379826 commit 2e0270c

File tree

21 files changed

+1106
-27
lines changed

21 files changed

+1106
-27
lines changed

.github/workflows/integration-tests.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ jobs:
7878
runs-on: ubuntu-latest
7979
needs: [integration-tests]
8080
if: ${{ (success() || failure()) && github.repository == 'linode/ansible_linode' }}
81+
outputs:
82+
summary: ${{ steps.set-test-summary.outputs.summary }}
8183

8284
steps:
8385
- name: Checkout code
@@ -127,6 +129,18 @@ jobs:
127129
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
128130
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
129131

132+
- name: Generate test summary and save to output
133+
id: set-test-summary
134+
run: |
135+
filename=$(ls | grep -E '^[0-9]{12}_ansible_merged\.xml$')
136+
test_output=$(python3 e2e_scripts/tod_scripts/generate_test_summary.py "${filename}")
137+
echo "$test_output"
138+
{
139+
echo 'summary<<EOF'
140+
echo "$test_output"
141+
echo EOF
142+
} >> "$GITHUB_OUTPUT"
143+
130144
apply-calico-rules:
131145
runs-on: ubuntu-latest
132146
needs: [integration-tests]
@@ -186,11 +200,12 @@ jobs:
186200

187201
notify-slack:
188202
runs-on: ubuntu-latest
189-
needs: [integration-tests]
203+
needs: [integration-tests, process-upload-report]
190204
if: ${{ (success() || failure()) && github.repository == 'linode/ansible_linode' }} # Run even if integration tests fail and only on main repository
191205

192206
steps:
193207
- name: Notify Slack
208+
id: main_message
194209
uses: slackapi/[email protected]
195210
with:
196211
method: chat.postMessage
@@ -201,7 +216,7 @@ jobs:
201216
- type: section
202217
text:
203218
type: mrkdwn
204-
text: ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
219+
text: ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* ${{ needs.integration-tests.result == 'success' && ':white_check_mark:' || ':failed:' }}"
205220
- type: divider
206221
- type: section
207222
fields:
@@ -219,4 +234,15 @@ jobs:
219234
- type: context
220235
elements:
221236
- type: mrkdwn
222-
text: "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
237+
text: "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
238+
239+
- name: Test summary thread
240+
if: success()
241+
uses: slackapi/[email protected]
242+
with:
243+
method: chat.postMessage
244+
token: ${{ secrets.SLACK_BOT_TOKEN }}
245+
payload: |
246+
channel: ${{ secrets.SLACK_CHANNEL_ID }}
247+
thread_ts: "${{ steps.main_message.outputs.ts }}"
248+
text: "${{ needs.process-upload-report.outputs.summary }}"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Name | Description |
2525
[linode.cloud.database_mysql](./docs/modules/database_mysql.md)|Manage a Linode MySQL database.|
2626
[linode.cloud.database_mysql_v2](./docs/modules/database_mysql_v2.md)|Create, read, and update a Linode MySQL database.|
2727
[linode.cloud.database_postgresql](./docs/modules/database_postgresql.md)|Manage a Linode PostgreSQL database.|
28+
[linode.cloud.database_postgresql_v2](./docs/modules/database_postgresql_v2.md)|Create, read, and update a Linode PostgreSQL database.|
2829
[linode.cloud.domain](./docs/modules/domain.md)|Manage Linode Domains.|
2930
[linode.cloud.domain_record](./docs/modules/domain_record.md)|Manage Linode Domain Records.|
3031
[linode.cloud.firewall](./docs/modules/firewall.md)|Manage Linode Firewalls.|

docs/modules/database_mysql_v2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Create, read, and update a Linode MySQL database.
103103
| `day_of_week` | <center>`int`</center> | <center>**Required**</center> | The day to perform maintenance. 1=Monday, 2=Tuesday, etc. **(Choices: `1`, `2`, `3`, `4`, `5`, `6`, `7`)** |
104104
| `duration` | <center>`int`</center> | <center>**Required**</center> | The maximum maintenance window time in hours. |
105105
| `hour_of_day` | <center>`int`</center> | <center>**Required**</center> | The hour to begin maintenance based in UTC time. |
106-
| `frequency` | <center>`str`</center> | <center>Optional</center> | Whether maintenance occurs on a weekly or monthly basis. **(Choices: `weekly`, `monthly`; Default: `weekly`)** |
106+
| `frequency` | <center>`str`</center> | <center>Optional</center> | The frequency at which maintenance occurs. **(Choices: `weekly`; Default: `weekly`)** |
107107

108108
## Return Values
109109

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# database_postgresql_v2
2+
3+
Create, read, and update a Linode PostgreSQL database.
4+
5+
- [Minimum Required Fields](#minimum-required-fields)
6+
- [Examples](#examples)
7+
- [Parameters](#parameters)
8+
- [Return Values](#return-values)
9+
10+
## Minimum Required Fields
11+
| Field | Type | Required | Description |
12+
|-------------|-------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
13+
| `api_token` | `str` | **Required** | The Linode account personal access token. It is necessary to run the module. <br/>It can be exposed by the environment variable `LINODE_API_TOKEN` instead. <br/>See details in [Usage](https://github.com/linode/ansible_linode?tab=readme-ov-file#usage). |
14+
15+
## Examples
16+
17+
```yaml
18+
- name: Create a basic PostgreSQL database
19+
linode.cloud.database_postgresql_v2:
20+
label: my-db
21+
region: us-mia
22+
engine: postgresql/16
23+
type: g6-nanode-1
24+
allow_list:
25+
- 0.0.0.0/0
26+
state: present
27+
```
28+
29+
```yaml
30+
- name: Create a PostgreSQL database with three nodes
31+
linode.cloud.database_postgresql_v2:
32+
label: my-db
33+
region: us-mia
34+
engine: postgresql/16
35+
type: g6-standard-1
36+
cluster_size: 3
37+
allow_list:
38+
- 0.0.0.0/0
39+
state: present
40+
```
41+
42+
```yaml
43+
- name: Create a PostgreSQL database with an explicit maintenance schedule
44+
linode.cloud.database_postgresql_v2:
45+
label: my-db
46+
region: us-mia
47+
engine: postgresql/16
48+
type: g6-nanode-1
49+
updates:
50+
duration: 4
51+
frequency: weekly
52+
hour_of_day: 16
53+
day_of_week: 4
54+
state: present
55+
```
56+
57+
```yaml
58+
- name: Create a PostgreSQL database forked from another database
59+
linode.cloud.database_postgresql_v2:
60+
label: my-db
61+
region: us-mia
62+
engine: postgresql/16
63+
type: g6-nanode-1
64+
fork:
65+
source: 12345
66+
state: present
67+
```
68+
69+
```yaml
70+
- name: Delete a PostgreSQL database
71+
linode.cloud.database_postgresql_v2:
72+
label: my-db
73+
state: absent
74+
```
75+
76+
77+
## Parameters
78+
79+
| Field | Type | Required | Description |
80+
|-----------|------|----------|------------------------------------------------------------------------------|
81+
| `state` | <center>`str`</center> | <center>**Required**</center> | The desired state of the Managed Database. **(Choices: `present`, `absent`)** |
82+
| `allow_list` | <center>`list`</center> | <center>Optional</center> | A list of IP addresses and CIDR ranges that can access the Managed Database. **(Updatable)** |
83+
| `cluster_size` | <center>`int`</center> | <center>Optional</center> | The number of Linode instance nodes deployed to the Managed Database. **(Updatable)** |
84+
| `engine` | <center>`str`</center> | <center>Optional</center> | The Managed Database engine in engine/version format. **(Updatable)** |
85+
| `label` | <center>`str`</center> | <center>Optional</center> | The label of the Managed Database. |
86+
| `region` | <center>`str`</center> | <center>Optional</center> | The region of the Managed Database. |
87+
| `type` | <center>`str`</center> | <center>Optional</center> | The Linode Instance type used by the Managed Database for its nodes. **(Updatable)** |
88+
| [`fork` (sub-options)](#fork) | <center>`dict`</center> | <center>Optional</center> | Information about a database to fork from. |
89+
| [`updates` (sub-options)](#updates) | <center>`dict`</center> | <center>Optional</center> | Configuration settings for automated patch update maintenance for the Managed Database. **(Updatable)** |
90+
| `wait_timeout` | <center>`int`</center> | <center>Optional</center> | The maximum number of seconds a poll operation can take before raising an error. **(Default: `2700`)** |
91+
92+
### fork
93+
94+
| Field | Type | Required | Description |
95+
|-----------|------|----------|------------------------------------------------------------------------------|
96+
| `restore_time` | <center>`str`</center> | <center>Optional</center> | The database timestamp from which it was restored. |
97+
| `source` | <center>`int`</center> | <center>Optional</center> | The instance id of the database that was forked from. |
98+
99+
### updates
100+
101+
| Field | Type | Required | Description |
102+
|-----------|------|----------|------------------------------------------------------------------------------|
103+
| `day_of_week` | <center>`int`</center> | <center>**Required**</center> | The day to perform maintenance. 1=Monday, 2=Tuesday, etc. **(Choices: `1`, `2`, `3`, `4`, `5`, `6`, `7`)** |
104+
| `duration` | <center>`int`</center> | <center>**Required**</center> | The maximum maintenance window time in hours. |
105+
| `hour_of_day` | <center>`int`</center> | <center>**Required**</center> | The hour to begin maintenance based in UTC time. |
106+
| `frequency` | <center>`str`</center> | <center>Optional</center> | The frequency at which maintenance occurs. **(Choices: `weekly`; Default: `weekly`)** |
107+
108+
## Return Values
109+
110+
- `database` - The database in JSON serialized form.
111+
112+
- Sample Response:
113+
```json
114+
{
115+
"allow_list": [
116+
"10.0.0.3/32"
117+
],
118+
"cluster_size": 3,
119+
"created": "2025-02-10T20:10:20",
120+
"encrypted": true,
121+
"engine": "postgresql",
122+
"hosts": {
123+
"primary": "a225891-akamai-prod-1798333-default.g2a.akamaidb.net",
124+
"standby": "replica-a225891-akamai-prod-1798333-default.g2a.akamaidb.net"
125+
},
126+
"id": 12345,
127+
"label": "my-db",
128+
"members": {
129+
"172.104.207.136": "primary",
130+
"194.195.112.177": "failover",
131+
"45.79.126.72": "failover"
132+
},
133+
"oldest_restore_time": "2025-02-10T20:15:07",
134+
"platform": "rdbms-default",
135+
"port": 11876,
136+
"region": "ap-west",
137+
"ssl_connection": true,
138+
"status": "active",
139+
"total_disk_size_gb": 30,
140+
"type": "g6-standard-1",
141+
"updated": "2025-02-10T20:25:55",
142+
"updates": {
143+
"day_of_week": 4,
144+
"duration": 4,
145+
"frequency": "weekly",
146+
"hour_of_day": 16,
147+
"pending": []
148+
},
149+
"used_disk_size_gb": 0,
150+
"version": "8.0.35"
151+
}
152+
```
153+
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-databases-postgre-sql-instance) for a list of returned fields
154+
155+
156+
- `ssl_cert` - The SSL CA certificate for an accessible Managed PostgreSQL Database.
157+
158+
- Sample Response:
159+
```json
160+
{
161+
"ca_certificate": "LS0tLS1CRUdJ...=="
162+
}
163+
```
164+
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-databases-postgresql-instance-ssl) for a list of returned fields
165+
166+
167+
- `credentials` - The root username and password for an accessible Managed PostgreSQL Database.
168+
169+
- Sample Response:
170+
```json
171+
{
172+
"password": "s3cur3P@ssw0rd",
173+
"username": "akmadmin"
174+
}
175+
```
176+
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-databases-postgre-sql-instance-credentials) for a list of returned fields
177+
178+

docs/modules/lke_cluster.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ Manage Linode LKE clusters.
6262
| `region` | <center>`str`</center> | <center>Optional</center> | This Kubernetes cluster’s location. |
6363
| `tags` | <center>`list`</center> | <center>Optional</center> | An array of tags applied to the Kubernetes cluster. |
6464
| `high_availability` | <center>`bool`</center> | <center>Optional</center> | Defines whether High Availability is enabled for the Control Plane Components of the cluster. **(Default: `False`; Updatable)** |
65-
| [`acl` (sub-options)](#acl) | <center>`dict`</center> | <center>Optional</center> | The ACL configuration for this cluster's control plane. NOTE: Control Plane ACLs may not currently be available to all users. **(Updatable)** |
65+
| [`acl` (sub-options)](#acl) | <center>`dict`</center> | <center>Optional</center> | The ACL configuration for this cluster's control plane. **(Updatable)** |
6666
| [`node_pools` (sub-options)](#node_pools) | <center>`list`</center> | <center>Optional</center> | A list of node pools to configure the cluster with **(Updatable)** |
6767
| `skip_polling` | <center>`bool`</center> | <center>Optional</center> | If true, the module will not wait for all nodes in the cluster to be ready. **(Default: `False`)** |
6868
| `wait_timeout` | <center>`int`</center> | <center>Optional</center> | The period to wait for the cluster to be ready in seconds. **(Default: `600`)** |
69+
| `apl_enabled` | <center>`bool`</center> | <center>Optional</center> | Whether this cluster should use APL. NOTE: This endpoint is in beta. **(Default: `False`)** |
6970

7071
### acl
7172

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
"""Documentation fragments for the database_postgresql_v2 module"""
2+
3+
specdoc_examples = ['''
4+
- name: Create a basic PostgreSQL database
5+
linode.cloud.database_postgresql_v2:
6+
label: my-db
7+
region: us-mia
8+
engine: postgresql/16
9+
type: g6-nanode-1
10+
allow_list:
11+
- 0.0.0.0/0
12+
state: present''', '''
13+
- name: Create a PostgreSQL database with three nodes
14+
linode.cloud.database_postgresql_v2:
15+
label: my-db
16+
region: us-mia
17+
engine: postgresql/16
18+
type: g6-standard-1
19+
cluster_size: 3
20+
allow_list:
21+
- 0.0.0.0/0
22+
state: present''', '''
23+
- name: Create a PostgreSQL database with an explicit maintenance schedule
24+
linode.cloud.database_postgresql_v2:
25+
label: my-db
26+
region: us-mia
27+
engine: postgresql/16
28+
type: g6-nanode-1
29+
updates:
30+
duration: 4
31+
frequency: weekly
32+
hour_of_day: 16
33+
day_of_week: 4
34+
state: present''', '''
35+
- name: Create a PostgreSQL database forked from another database
36+
linode.cloud.database_postgresql_v2:
37+
label: my-db
38+
region: us-mia
39+
engine: postgresql/16
40+
type: g6-nanode-1
41+
fork:
42+
source: 12345
43+
state: present''', '''
44+
- name: Delete a PostgreSQL database
45+
linode.cloud.database_postgresql_v2:
46+
label: my-db
47+
state: absent''']
48+
49+
result_database_samples = ['''{
50+
"allow_list": [
51+
"10.0.0.3/32"
52+
],
53+
"cluster_size": 3,
54+
"created": "2025-02-10T20:10:20",
55+
"encrypted": true,
56+
"engine": "postgresql",
57+
"hosts": {
58+
"primary": "a225891-akamai-prod-1798333-default.g2a.akamaidb.net",
59+
"standby": "replica-a225891-akamai-prod-1798333-default.g2a.akamaidb.net"
60+
},
61+
"id": 12345,
62+
"label": "my-db",
63+
"members": {
64+
"172.104.207.136": "primary",
65+
"194.195.112.177": "failover",
66+
"45.79.126.72": "failover"
67+
},
68+
"oldest_restore_time": "2025-02-10T20:15:07",
69+
"platform": "rdbms-default",
70+
"port": 11876,
71+
"region": "ap-west",
72+
"ssl_connection": true,
73+
"status": "active",
74+
"total_disk_size_gb": 30,
75+
"type": "g6-standard-1",
76+
"updated": "2025-02-10T20:25:55",
77+
"updates": {
78+
"day_of_week": 4,
79+
"duration": 4,
80+
"frequency": "weekly",
81+
"hour_of_day": 16,
82+
"pending": []
83+
},
84+
"used_disk_size_gb": 0,
85+
"version": "8.0.35"
86+
}''']
87+
88+
result_credentials_samples = ['''{
89+
"password": "s3cur3P@ssw0rd",
90+
"username": "akmadmin"
91+
}''']
92+
93+
result_ssl_cert_samples = ['''{
94+
"ca_certificate": "LS0tLS1CRUdJ...=="
95+
}''']

plugins/module_utils/linode_database_shared.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,9 @@
7777
),
7878
"frequency": SpecField(
7979
type=FieldType.string,
80-
choices=["weekly", "monthly"],
80+
choices=["weekly"],
8181
default="weekly",
82-
description=[
83-
"Whether maintenance occurs on a weekly or monthly basis."
84-
],
82+
description=["The frequency at which maintenance occurs."],
8583
),
8684
"hour_of_day": SpecField(
8785
type=FieldType.integer,

0 commit comments

Comments
 (0)