Skip to content

Commit b821080

Browse files
dguidoclaude
andauthored
Fix AWS Lightsail deployment error (boto3 parameter) (#14823)
* Fix AWS Lightsail deployment error by removing deprecated boto3 parameter Remove the deprecated boto3 parameter from get_aws_connection_info() call in the lightsail_region_facts module. This parameter has been non-functional since amazon.aws collection 4.0.0 and was removed in recent versions bundled with Ansible 11.x, causing deployment failures. The function works correctly without this parameter as the module already properly imports and validates boto3 availability. Closes #14822 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Update uv.lock to fix Docker build failure The lockfile was out of sync after the Ansible 11.8.0 to 11.9.0 upgrade. This regenerates the lockfile to include: - ansible 11.9.0 (was 11.8.0) - ansible-core 2.18.8 (was 2.18.7) This fixes the Docker build CI failure where uv sync --locked was failing due to lockfile mismatch. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Fix Jinja spacing linter issues correctly - Add spacing in lookup('env', 'VAR') calls - Fix spacing around pipe operators within Jinja expressions only - Preserve YAML block scalar syntax (prompt: |) - Fix array indexing spacing within Jinja expressions - All changes pass yamllint and ansible-lint tests 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Add algo.egg-info to .gitignore * Add unit test for AWS Lightsail boto3 parameter fix - Tests that get_aws_connection_info() is called without boto3 parameter - Verifies the module can be imported successfully - Checks source code doesn't contain boto3=True - Regression test specifically for issue #14822 - All 4 test cases pass This ensures the fix remains in place and prevents regression. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Fix Python linting issues in test file - Sort imports according to ruff standards - Remove trailing whitespace from blank lines - Remove unnecessary 'r' mode argument from open() - Add trailing newline at end of file All tests still pass after linting fixes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent 55e4cab commit b821080

File tree

44 files changed

+280
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+280
-122
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ inventory_users
1010
.ansible/
1111
__pycache__/
1212
*.pyc
13+
algo.egg-info/

input.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
- name: Set facts based on the input
4444
set_fact:
45-
algo_provider: "{{ provider | default(providers_map[_algo_provider.user_input|default(omit)|int - 1]['alias']) }}"
45+
algo_provider: "{{ provider | default(providers_map[_algo_provider.user_input | default(omit) | int - 1]['alias']) }}"
4646

4747
- name: VPN server name prompt
4848
pause:
@@ -110,10 +110,10 @@
110110
set_fact:
111111
algo_server_name: >-
112112
{% if server_name is defined %}{% set _server = server_name %}
113-
{%- elif _algo_server_name.user_input is defined and _algo_server_name.user_input|length > 0 -%}
113+
{%- elif _algo_server_name.user_input is defined and _algo_server_name.user_input | length > 0 -%}
114114
{%- set _server = _algo_server_name.user_input -%}
115115
{%- else %}{% set _server = defaults['server_name'] %}{% endif -%}
116-
{{ _server | regex_replace('(?!\.)(\W|_)', '-') }}
116+
{{ _server | regex_replace('(?!\.)(\W | _)', '-') }}
117117
algo_ondemand_cellular: >-
118118
{% if ondemand_cellular is defined %}{{ ondemand_cellular | bool }}
119119
{%- elif _ondemand_cellular.user_input is defined %}{{ booleans_map[_ondemand_cellular.user_input] | default(defaults['ondemand_cellular']) }}
@@ -124,7 +124,7 @@
124124
{%- else %}false{% endif %}
125125
algo_ondemand_wifi_exclude: >-
126126
{% if ondemand_wifi_exclude is defined %}{{ ondemand_wifi_exclude | b64encode }}
127-
{%- elif _ondemand_wifi_exclude.user_input is defined and _ondemand_wifi_exclude.user_input|length > 0 -%}
127+
{%- elif _ondemand_wifi_exclude.user_input is defined and _ondemand_wifi_exclude.user_input | length > 0 -%}
128128
{{ _ondemand_wifi_exclude.user_input | b64encode }}
129129
{%- else %}{{ '_null' | b64encode }}{% endif %}
130130
algo_dns_adblocking: >-

library/lightsail_region_facts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def main():
8282
module.fail_json(msg='Python module "botocore" is missing, please install it')
8383

8484
try:
85-
region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module, boto3=True)
85+
region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module)
8686

8787
client = None
8888
try:

playbooks/cloud-post.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
name: "{% if cloud_instance_ip == 'localhost' %}localhost{% else %}{{ cloud_instance_ip }}{% endif %}"
99
groups: vpn-host
1010
ansible_connection: "{% if cloud_instance_ip == 'localhost' %}local{% else %}ssh{% endif %}"
11-
ansible_ssh_user: "{{ ansible_ssh_user|default('root') }}"
12-
ansible_ssh_port: "{{ ansible_ssh_port|default(22) }}"
11+
ansible_ssh_user: "{{ ansible_ssh_user | default('root') }}"
12+
ansible_ssh_port: "{{ ansible_ssh_port | default(22) }}"
1313
ansible_python_interpreter: /usr/bin/python3
1414
algo_provider: "{{ algo_provider }}"
1515
algo_server_name: "{{ algo_server_name }}"
@@ -21,7 +21,7 @@
2121
algo_store_pki: "{{ algo_store_pki }}"
2222
IP_subject_alt_name: "{{ IP_subject_alt_name }}"
2323
alternative_ingress_ip: "{{ alternative_ingress_ip | default(omit) }}"
24-
cloudinit: "{{ cloudinit|default(false) }}"
24+
cloudinit: "{{ cloudinit | default(false) }}"
2525

2626
- name: Additional variables for the server
2727
add_host:
@@ -31,7 +31,7 @@
3131

3232
- name: Wait until SSH becomes ready...
3333
wait_for:
34-
port: "{{ ansible_ssh_port|default(22) }}"
34+
port: "{{ ansible_ssh_port | default(22) }}"
3535
host: "{{ cloud_instance_ip }}"
3636
search_regex: OpenSSH
3737
delay: 10

roles/cloud-azure/tasks/prompts.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
- set_fact:
3-
secret: "{{ azure_secret | default(lookup('env','AZURE_SECRET'), true) }}"
4-
tenant: "{{ azure_tenant | default(lookup('env','AZURE_TENANT'), true) }}"
5-
client_id: "{{ azure_client_id | default(lookup('env','AZURE_CLIENT_ID'), true) }}"
6-
subscription_id: "{{ azure_subscription_id | default(lookup('env','AZURE_SUBSCRIPTION_ID'), true) }}"
3+
secret: "{{ azure_secret | default(lookup('env', 'AZURE_SECRET'), true) }}"
4+
tenant: "{{ azure_tenant | default(lookup('env', 'AZURE_TENANT'), true) }}"
5+
client_id: "{{ azure_client_id | default(lookup('env', 'AZURE_CLIENT_ID'), true) }}"
6+
subscription_id: "{{ azure_subscription_id | default(lookup('env', 'AZURE_SUBSCRIPTION_ID'), true) }}"
77

88
- block:
99
- name: Set the default region

roles/cloud-cloudstack/tasks/prompts.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
register: _cs_key
88
when:
99
- cs_key is undefined
10-
- lookup('env','CLOUDSTACK_KEY')|length <= 0
10+
- lookup('env', 'CLOUDSTACK_KEY')|length <= 0
1111

1212
- pause:
1313
prompt: |
@@ -16,7 +16,7 @@
1616
register: _cs_secret
1717
when:
1818
- cs_secret is undefined
19-
- lookup('env','CLOUDSTACK_SECRET')|length <= 0
19+
- lookup('env', 'CLOUDSTACK_SECRET')|length <= 0
2020

2121
- pause:
2222
prompt: |
@@ -28,8 +28,8 @@
2828
- lookup('env', 'CLOUDSTACK_ENDPOINT') | length <= 0
2929

3030
- set_fact:
31-
algo_cs_key: "{{ cs_key | default(_cs_key.user_input|default(None)) | default(lookup('env', 'CLOUDSTACK_KEY'), true) }}"
32-
algo_cs_token: "{{ cs_secret | default(_cs_secret.user_input|default(None)) | default(lookup('env', 'CLOUDSTACK_SECRET'), true) }}"
31+
algo_cs_key: "{{ cs_key | default(_cs_key.user_input | default(None)) | default(lookup('env', 'CLOUDSTACK_KEY'), true) }}"
32+
algo_cs_token: "{{ cs_secret | default(_cs_secret.user_input | default(None)) | default(lookup('env', 'CLOUDSTACK_SECRET'), true) }}"
3333
algo_cs_url: >-
3434
{{ cs_url | default(_cs_url.user_input|default(None)) |
3535
default(lookup('env', 'CLOUDSTACK_ENDPOINT'), true) |

roles/cloud-digitalocean/tasks/prompts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
register: _do_token
77
when:
88
- do_token is undefined
9-
- lookup('env','DO_API_TOKEN')|length <= 0
9+
- lookup('env', 'DO_API_TOKEN')|length <= 0
1010

1111
- name: Set the token as a fact
1212
set_fact:
13-
algo_do_token: "{{ do_token | default(_do_token.user_input|default(None)) | default(lookup('env','DO_API_TOKEN'), true) }}"
13+
algo_do_token: "{{ do_token | default(_do_token.user_input | default(None)) | default(lookup('env', 'DO_API_TOKEN'), true) }}"
1414

1515
- name: Get regions
1616
uri:

roles/cloud-ec2/tasks/prompts.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
no_log: true
2323
when:
2424
- aws_access_key is undefined
25-
- lookup('env','AWS_ACCESS_KEY_ID')|length <= 0
25+
- lookup('env', 'AWS_ACCESS_KEY_ID')|length <= 0
2626

2727
# Prompt for credentials if still not available
2828
- pause:
@@ -33,7 +33,7 @@
3333
register: _aws_access_key
3434
when:
3535
- aws_access_key is undefined
36-
- lookup('env','AWS_ACCESS_KEY_ID')|length <= 0
36+
- lookup('env', 'AWS_ACCESS_KEY_ID')|length <= 0
3737
- _file_access_key is undefined or _file_access_key|length <= 0
3838

3939
- pause:
@@ -43,7 +43,7 @@
4343
register: _aws_secret_key
4444
when:
4545
- aws_secret_key is undefined
46-
- lookup('env','AWS_SECRET_ACCESS_KEY')|length <= 0
46+
- lookup('env', 'AWS_SECRET_ACCESS_KEY')|length <= 0
4747
- _file_secret_key is undefined or _file_secret_key|length <= 0
4848

4949
# Set final credentials with proper precedence

roles/cloud-gce/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
ports:
3030
- "500"
3131
- "4500"
32-
- "{{ wireguard_port|string }}"
32+
- "{{ wireguard_port | string }}"
3333
- ip_protocol: tcp
3434
ports:
3535
- "{{ ssh_port }}"
@@ -70,7 +70,7 @@
7070
- network: "{{ gcp_compute_network }}"
7171
access_configs:
7272
- name: "{{ algo_server_name }}"
73-
nat_ip: "{{ gcp_compute_address|default(None) }}"
73+
nat_ip: "{{ gcp_compute_address | default(None) }}"
7474
type: ONE_TO_ONE_NAT
7575
tags:
7676
items:

roles/cloud-gce/tasks/prompts.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
register: _gce_credentials_file
77
when:
88
- gce_credentials_file is undefined
9-
- lookup('env','GCE_CREDENTIALS_FILE_PATH')|length <= 0
9+
- lookup('env', 'GCE_CREDENTIALS_FILE_PATH')|length <= 0
1010

1111
- set_fact:
1212
credentials_file_path: >-
1313
{{ gce_credentials_file | default(_gce_credentials_file.user_input|default(None)) |
14-
default(lookup('env','GCE_CREDENTIALS_FILE_PATH'), true) }}
14+
default(lookup('env', 'GCE_CREDENTIALS_FILE_PATH'), true) }}
1515
ssh_public_key_lookup: "{{ lookup('file', '{{ SSH_keys.public }}') }}"
1616

1717
- set_fact:
1818
credentials_file_lookup: "{{ lookup('file', '{{ credentials_file_path }}') }}"
1919

2020
- set_fact:
21-
service_account_email: "{{ credentials_file_lookup.client_email | default(lookup('env','GCE_EMAIL')) }}"
22-
project_id: "{{ credentials_file_lookup.project_id | default(lookup('env','GCE_PROJECT')) }}"
21+
service_account_email: "{{ credentials_file_lookup.client_email | default(lookup('env', 'GCE_EMAIL')) }}"
22+
project_id: "{{ credentials_file_lookup.project_id | default(lookup('env', 'GCE_PROJECT')) }}"
2323

2424
- block:
2525
- name: Get regions

0 commit comments

Comments
 (0)