ansible / terraform-provider-ansible

community terraform provider for ansible
https://registry.terraform.io/providers/ansible/ansible/latest
GNU General Public License v3.0
183 stars 42 forks source link

failed to query available provider packages #122

Open charliemizz opened 1 month ago

charliemizz commented 1 month ago

We have updated our ansible provider to 1.3.0, after running a plan we have started to see the following:

Error: Failed to query available provider packages │ │ Could not retrieve the list of available versions for provider │ ansible/ansible: locked provider registry.terraform.io/ansible/ansible │ 1.3.0 does not match configured version constraint 1.1.0, 1.3.0; must use │ terraform init -upgrade to allow selection of new versions

Originally we were on 1.1.0 and had started to receive the below hence why we attempted to update the provider.

│ Error: Incompatible provider version │ │ Provider registry.terraform.io/ansible/ansible v1.1.0 does not have a │ package available for your current platform, linux_amd64. │ │ Provider releases are separate from Terraform CLI releases, so not all │ providers are available for all platforms. Other versions of this provider │ may have different platforms supported.

We are currently stuck and unable to use the ansible provider at this point.

platymatt commented 1 month ago

Not 100% sure if related but the signing keys seem to be broken in the provider API. I was trying to download the 1.1.0 provider with this link https://registry.terraform.io/v1/providers/ansible/ansible/1.1.0/download/linux/amd64 but getting the error: {"errors":["signing key 7664CDD95312BDBD not found for ansible"]}

When this link for the most recent provider works: https://registry.terraform.io/v1/providers/ansible/ansible/1.3.0/download/linux/amd64

I'm installing it for offline use in a docker container and had to bump to 1.3.0 to get the below to work.

ARG TF_ANSIBLE_PROVIDER_VERSION="1.3.0"
ENV TF_ANSIBLE_PROVIDER_VERSION=${TF_ANSIBLE_PROVIDER_VERSION}
ENV ANSIBLE_PLUGIN_DIR="${TF_PLUGIN_DIR}/registry.terraform.io/ansible/ansible/${TF_ANSIBLE_PROVIDER_VERSION}/linux_amd64/"
RUN ANSIBLE_URL=$(wget -qO- "https://registry.terraform.io/v1/providers/ansible/ansible/${TF_ANSIBLE_PROVIDER_VERSION}/download/linux/amd64" | jq -r .download_url) \
  && wget "$ANSIBLE_URL" -P /tmp/provider --progress=dot:giga \
  && mkdir -p "$ANSIBLE_PLUGIN_DIR" \
  && unzip /tmp/provider/*.zip -d "$ANSIBLE_PLUGIN_DIR" \
  && rm -rf /var/tmp/* /tmp/* /var/tmp/.???* /tmp/.???*
charliemizz commented 1 month ago

Seems related as 1.1.0 is not playing nicely, We ended up getting 1.3.0 working (missed out a provider block that needed updating) and pipelines are now behaving.