Skip to content

Commit 0624dc8

Browse files
authored
Merge pull request #18 from serverscom/updating_ansible_version
Updating ansible version
2 parents 167c4df + aea5d7f commit 0624dc8

19 files changed

+104
-87
lines changed

.github/workflows/tests.yaml

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ name: Test and build
55
push:
66
paths-ignore:
77
- ".github/**"
8+
workflow_dispatch:
89

910
jobs:
1011
lint:
@@ -22,10 +23,7 @@ jobs:
2223
strategy:
2324
matrix:
2425
python_version:
25-
- "3.8"
26-
- "3.7"
27-
- "3.6"
28-
# - "3.10"
26+
- "3.11"
2927
steps:
3028
- name: Checkout
3129
uses: actions/checkout@v3
@@ -36,7 +34,6 @@ jobs:
3634
- name: Install dependencies
3735
run: |
3836
python -m pip install --upgrade pip
39-
pip install flake8 pytest
4037
pip install -r requirements.txt
4138
- name: Sanity tests with dependencies
4239
run: ansible-test sanity --requirements --python ${{ matrix.python_version }}
@@ -55,22 +52,21 @@ jobs:
5552
steps:
5653
- name: Checkout
5754
uses: actions/checkout@v3
58-
- name: Set up Python 3.8
55+
- name: Set up Python
5956
uses: actions/setup-python@v2
6057
with:
61-
python-version: "3.8"
58+
python-version: "3.11"
6259
- name: Install dependencies
6360
run: |
6461
python -m pip install --upgrade pip
65-
pip install flake8 pytest
6662
pip install -r requirements.txt
6763
- name: Configure integration tests
6864
run: |
6965
envsubst < integration_config.yml.template > ansible_collections/serverscom/sc_api/tests/integration/integration_config.yml
7066
env:
7167
SC_TOKEN: "${{ secrets.SC_TOKEN }}"
7268
- name: Integration tests
73-
run: ansible-test integration --requirements --python 3.8
69+
run: ansible-test integration --requirements --python 3.11
7470
sc_ssh_key
7571
sc_cloud_computing_flavors_info
7672
sc_cloud_computing_regions_info
@@ -98,22 +94,21 @@ jobs:
9894
steps:
9995
- name: Checkout
10096
uses: actions/checkout@v3
101-
- name: Set up Python 3.8
97+
- name: Set up Python
10298
uses: actions/setup-python@v2
10399
with:
104-
python-version: "3.8"
100+
python-version: "3.11"
105101
- name: Install dependencies
106102
run: |
107103
python -m pip install --upgrade pip
108-
pip install flake8 pytest
109104
pip install -r requirements.txt
110105
- name: Configure integration tests
111106
run: |
112107
envsubst < integration_config.yml.template > ansible_collections/serverscom/sc_api/tests/integration/integration_config.yml
113108
env:
114109
SC_TOKEN: "${{ secrets.SC_TOKEN }}"
115110
- name: Integration tests
116-
run: ansible-test integration --requirements --python 3.8
111+
run: ansible-test integration --requirements --python 3.11
117112
sc_ssh_key
118113
sc_baremetal_locations_info
119114
sc_baremetal_servers_info
@@ -136,22 +131,21 @@ jobs:
136131
steps:
137132
- name: Checkout
138133
uses: actions/checkout@v3
139-
- name: Set up Python 3.8
134+
- name: Set up Python
140135
uses: actions/setup-python@v2
141136
with:
142-
python-version: "3.8"
137+
python-version: "3.11"
143138
- name: Install dependencies
144139
run: |
145140
python -m pip install --upgrade pip
146-
pip install flake8 pytest
147141
pip install -r requirements.txt
148142
- name: Configure integration tests
149143
run: |
150144
envsubst < integration_config.yml.template > ansible_collections/serverscom/sc_api/tests/integration/integration_config.yml
151145
env:
152146
SC_TOKEN: "${{ secrets.SC_TOKEN }}"
153147
- name: Integration tests
154-
run: ansible-test integration --requirements --python 3.8
148+
run: ansible-test integration --requirements --python 3.11
155149
sc_l2_segment
156150
sc_l2_segment_aliases
157151
sc_l2_segments_info
@@ -172,14 +166,13 @@ jobs:
172166
steps:
173167
- name: Checkout
174168
uses: actions/checkout@v3
175-
- name: Set up Python 3.8
169+
- name: Set up Python
176170
uses: actions/setup-python@v2
177171
with:
178-
python-version: 3.8
172+
python-version: "3.11"
179173
- name: Install dependencies
180174
run: |
181175
python -m pip install --upgrade pip
182-
pip install flake8 pytest
183176
pip install -r requirements.txt
184177
- name: Remove tests from final distribution
185178
run: rm -r tests/

ansible_collections/serverscom/sc_api/plugins/module_utils/modules.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
__metaclass__ = type
1515

16+
_ignored = DEFAULT_API_ENDPOINT # to silence pylint warning, it is reimported
1617

1718
CHANGED = True
1819
NOT_CHANGED = False

ansible_collections/serverscom/sc_api/plugins/modules/sc_baremetal_servers_info.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
Retrive list of all existing dedicated baremetal servers.
2727
2828
notes:
29-
- Not to be confused with M(sc_dedicated_servers_info).
29+
- Not to be confused with M(serverscom.sc_api.sc_dedicated_servers_info).
3030
- Includes information for both dedicated and other types of servers
3131
(f.e. kubernetes baremetal node)
3232
@@ -88,7 +88,6 @@
8888

8989

9090
from ansible.module_utils.basic import AnsibleModule
91-
import json
9291
from ansible_collections.serverscom.sc_api.plugins.module_utils.modules import (
9392
DEFAULT_API_ENDPOINT,
9493
SCBaseError,

ansible_collections/serverscom/sc_api/plugins/modules/sc_cloud_computing_flavors_info.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
required: true
4747
description:
4848
- Id of cloud computing region.
49-
- Use I(sc_cloud_computing_regions_info) module to retrive list of
50-
available regions.
49+
- Use I(serverscom.sc_api.sc_cloud_computing_regions_info) module
50+
to retrive list of available regions.
5151
"""
5252

5353
RETURN = """
@@ -101,7 +101,6 @@
101101

102102

103103
from ansible.module_utils.basic import AnsibleModule
104-
import json
105104
from ansible_collections.serverscom.sc_api.plugins.module_utils.modules import (
106105
DEFAULT_API_ENDPOINT,
107106
SCBaseError,

ansible_collections/serverscom/sc_api/plugins/modules/sc_cloud_computing_images_info.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
required: true
4848
description:
4949
- Id of cloud computing region.
50-
- Use I(sc_cloud_computing_regions_info) module to retrive list of
51-
available regions.
50+
- Use I(serverscom.sc_api.sc_cloud_computing_regions_info) module
51+
to retrive list of available regions.
5252
"""
5353

5454
RETURN = """
@@ -107,7 +107,6 @@
107107

108108

109109
from ansible.module_utils.basic import AnsibleModule
110-
import json
111110
from ansible_collections.serverscom.sc_api.plugins.module_utils.modules import (
112111
DEFAULT_API_ENDPOINT,
113112
SCBaseError,

ansible_collections/serverscom/sc_api/plugins/modules/sc_cloud_computing_instance.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
type: int
7575
description:
7676
- Id of the cloud region for the instance
77-
- Use M(sc_cloud_computing_regions_info) to get list of available
78-
regions.
77+
- Use M(serverscom.sc_api.sc_cloud_computing_regions_info) to get list
78+
of available regions.
7979
- Required for I(state)=C(present).
8080
- May be used for other I(state) to narrow search to one region with
8181
I(name).
@@ -162,8 +162,8 @@
162162
type: str
163163
description:
164164
- Fingerprint of the public ssh key to use for user cloud-user.
165-
- Fingerprint must be registered. Use M(sc_ssh_key) to register
166-
public key.
165+
- Fingerprint must be registered. Use M(serverscom.sc_api.sc_ssh_key)
166+
to register public key.
167167
- Mutually exclusive with I(ssh_key_name)
168168
- Instance is created with password if no I(ssh_key_fingerprint)
169169
or I(ssh_key_name) is used.
@@ -209,8 +209,8 @@
209209
- Value C(0) is used to disable wait.
210210
- If C(0) is set, module works in 'fire-and-forget' mode.
211211
- ACTIVE state doesn't mean that instance is ready to accept ssh
212-
connections. Use M(wait_for_connection) module wait until instance
213-
finishes booting.
212+
connections. Use M(ansible.builtin.wait_for_connection) module
213+
to wait until instance finishes booting.
214214
- wait time is independent for I(retry_on_conflicts) and status wait.
215215
- If instance is in conflicting state, first module will retry up to
216216
I(wait) seconds to delete it, and then wait for I(wait) seconds for
@@ -242,8 +242,8 @@
242242
- Upgrades are autoconfirmed in 72 hours.
243243
- Used only for I(state)=C(upgraded), ignored of other I(state).
244244
- If instance is in the state AWAITING_UPGRADE_CONFIRM,
245-
calling M(cloud_computing_instance) with I(state)=C(upgraded)
246-
confirm upgrade.
245+
calling M(serverscom.sc_api.cloud_computing_instance)
246+
with I(state)=C(upgraded) confirm upgrade.
247247
- If I(wait)=C(0) instance upgrage is not confirmed even if
248248
I(confirm_upgrade)=C(true).
249249
"""
@@ -376,15 +376,15 @@
376376

377377
EXAMPLES = """
378378
- name: Delete instance by ID
379-
sc_cloud_computing_instance:
379+
serverscom.sc_api.sc_cloud_computing_instance:
380380
token: '{{ sc_token }}'
381381
instance_id: M7e5Ba2v
382382
state: absent
383383
wait: 60
384384
update_interval: 5
385385
386386
- name: Delete instance by name in region 3
387-
sc_cloud_computing_instance:
387+
serverscom.sc_api.sc_cloud_computing_instance:
388388
token: '{{ sc_token }}'
389389
name: test
390390
region_id: 3

ansible_collections/serverscom/sc_api/plugins/modules/sc_cloud_computing_instance_info.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@
214214

215215

216216
from ansible.module_utils.basic import AnsibleModule
217-
import json
218217
from ansible_collections.serverscom.sc_api.plugins.module_utils.modules import (
219218
DEFAULT_API_ENDPOINT,
220219
SCBaseError,

ansible_collections/serverscom/sc_api/plugins/modules/sc_cloud_computing_instance_ptr.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@
148148

149149

150150
from ansible.module_utils.basic import AnsibleModule
151-
import json
152151
from ansible_collections.serverscom.sc_api.plugins.module_utils.modules import (
153152
DEFAULT_API_ENDPOINT,
154153
SCBaseError,

ansible_collections/serverscom/sc_api/plugins/modules/sc_cloud_computing_instance_state.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
description: >
2727
Allow to control power state and rescue mode for instance.
2828
This module does not allow removal and creation of the instance,
29-
use M(sc_cloud_computing_instance) with state=present/absent.
29+
use M(serverscom.sc_api.sc_cloud_computing_instance)
30+
with state=present/absent.
3031
3132
options:
3233
endpoint:
@@ -111,9 +112,9 @@
111112
- Value C(0) is used to disable wait.
112113
- If C(0) is set, module works in 'fire-and-forget' mode.
113114
- ACTIVE state doesn't mean that instance is ready to accept ssh
114-
connections. Use M(wait_for_connection) module wait until instance
115-
finishes booting. handlers or when statement may be used
116-
to preserve idempotency.
115+
connections. Use M(ansible.builtin.wait_for_connection) module
116+
wait until instance finishes booting.
117+
handlers or when statement may be used to preserve idempotency.
117118
118119
update_interval:
119120
type: int
@@ -280,7 +281,6 @@
280281

281282

282283
from ansible.module_utils.basic import AnsibleModule
283-
import json
284284
from ansible_collections.serverscom.sc_api.plugins.module_utils.modules import (
285285
DEFAULT_API_ENDPOINT,
286286
SCBaseError,

ansible_collections/serverscom/sc_api/plugins/modules/sc_cloud_computing_instances_info.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
type: int
4646
description:
4747
- Id of cloud computing region to filter.
48-
- Use I(sc_cloud_computing_regions_info) module to retrive list of
49-
available regions.
48+
- Use I(serverscom.sc_api.sc_cloud_computing_regions_info) module
49+
to retrive list of available regions.
5050
- Module returns instances for all regions if I(region_id) is not
5151
specified.
5252
"""
@@ -178,7 +178,6 @@
178178

179179

180180
from ansible.module_utils.basic import AnsibleModule
181-
import json
182181
from ansible_collections.serverscom.sc_api.plugins.module_utils.modules import (
183182
DEFAULT_API_ENDPOINT,
184183
SCBaseError,

ansible_collections/serverscom/sc_api/plugins/modules/sc_cloud_computing_openstack_credentials.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
required: true
6060
description:
6161
- Id of cloud computing region.
62-
- Use I(sc_cloud_computing_regions_info) module to retrive list of
63-
available regions.
62+
- Use I(serverscom.sc_api.sc_cloud_computing_regions_info) module
63+
to retrive list of available regions.
6464
"""
6565

6666
RETURN = """
@@ -132,7 +132,6 @@
132132

133133

134134
from ansible.module_utils.basic import AnsibleModule
135-
import json
136135
from ansible_collections.serverscom.sc_api.plugins.module_utils.modules import (
137136
DEFAULT_API_ENDPOINT,
138137
SCBaseError,

ansible_collections/serverscom/sc_api/plugins/modules/sc_dedicated_server_info.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250

251251
EXAMPLES = """
252252
- name: Get server info
253-
sc_dedicated_server_info:
253+
serverscom.sc_api.sc_dedicated_server_info:
254254
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MzgxMjEsInR5cGUiOiJVc2VyIiwiYWNjZXNzX2dyYW50X2lkIjoyNjgwNywiZXhwIjoyMjI2OTk3NjMwfQ.rO4nGXNgXggjNmMJBLXovOh1coNrDWl4dGrGFupYXJE'
255255
id: '0m592Zmn'
256256
register: srv
@@ -259,7 +259,7 @@
259259
msg: 'Server {{ srv.name }} has IP {{ srv.public_ipv4_address }}'
260260
261261
- name: Wait until server is ready
262-
sc_dedicated_server_info:
262+
serverscom.sc_api.sc_dedicated_server_info:
263263
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MzgxMjEsInR5cGUiOiJVc2VyIiwiYWNjZXNzX2dyYW50X2lkIjoyNjgwNywiZXhwIjoyMjI2OTk3NjMwfQ.rO4nGXNgXggjNmMJBLXovOh1coNrDWl4dGrGFupYXJE'
264264
id: '0m592Zmn'
265265
register: srv
@@ -270,7 +270,6 @@
270270

271271

272272
from ansible.module_utils.basic import AnsibleModule
273-
import json
274273
from ansible_collections.serverscom.sc_api.plugins.module_utils.modules import (
275274
DEFAULT_API_ENDPOINT,
276275
SCBaseError,

ansible_collections/serverscom/sc_api/plugins/modules/sc_dedicated_server_reinstall.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
elements: str
156156
description:
157157
- Array of fingerprints of public ssh keys to add for root user.
158-
- Keys must be registered before use by module M(sc_ssh_key).
158+
- Keys must be registered before use by module M(serverscom.sc_api.sc_ssh_key).
159159
- Mutually exclusive with I(ssh_key_name).
160160
- Server is reinstalled with root password only if no I(ssh_keys) or
161161
I(ssh_key_name) specified.
@@ -181,8 +181,8 @@
181181
- When server become 'ready' after reinstallation,
182182
it can still be in booting state for some time
183183
and do not answer ssh/ping request.
184-
Use M(wait_for_connection) module to wait the server
185-
to become available though ssh.
184+
Use M(serverscom.sc_api.wait_for_connection) module
185+
to wait the server to become available though ssh.
186186
- Installation may start few minutes later than request,
187187
during this time server is responding with 'old' ssh.
188188

ansible_collections/serverscom/sc_api/plugins/modules/sc_ssh_key.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117

118118

119119
from ansible.module_utils.basic import AnsibleModule
120-
import json
121120
from ansible_collections.serverscom.sc_api.plugins.module_utils.modules import (
122121
DEFAULT_API_ENDPOINT,
123122
SCBaseError,

ansible_collections/serverscom/sc_api/plugins/modules/sc_ssh_keys_info.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989

9090

9191
from ansible.module_utils.basic import AnsibleModule
92-
import json
9392
from ansible_collections.serverscom.sc_api.plugins.module_utils.modules import (
9493
DEFAULT_API_ENDPOINT,
9594
SCBaseError,

0 commit comments

Comments
 (0)