Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An exception occurred during task execution. The error was: ValueError: ansible_collections.amazon.aws.plugins.module_utils.core.__spec__ is None #226

Open
Teja446 opened this issue Jun 2, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Teja446
Copy link

Teja446 commented Jun 2, 2023

I have tried exploring amazon cloud (amazon.aws collections ) with crossplane ansible provider but after applying ansible run observing below error in pod logs .
Error in ansible run pod logs:-
image
Error after describing ansiblerun yamlcode :-
image
image

code to reproduce issue :-
Created provider config and passed secret and added collections in requirements
ProviderConfig.yaml

apiVersion: ansible.crossplane.io/v1alpha1
kind: ProviderConfig
metadata:
name: ansibleawsconfig
spec:
credentials:
- filename: aws-credentials.json
source: Secret
secretRef:
namespace: crossplane-system
name: aws-secret
key: credentials
requirements: |
---
collections:
- name: amazon.aws
source: https://galaxy.ansible.com
version: "5.4.0"

Implemented playbook task to create and manage aws ec2 instance , below is the yaml code

Ansiblerun example yaml code :-

apiVersion: ansible.crossplane.io/v1alpha1
kind: AnsibleRun
metadata:
annotations:
ansible.crossplane.io/runPolicy: ObserveAndDelete
name: awsec2restart
spec:
forProvider:
playbookInline: |
---
- hosts: localhost
tasks:
- name: start an instance with a public IP address
amazon.aws.ec2_instance:
name: "public-compute-instance"
key_name: "prod-ssh-key"
vpc_subnet_id: default
instance_type: t2.micro
security_group: default
network:
assign_public_ip: true
image_id: ami-0715c1897453cabd1
tags:
Environment: Testing
providerConfigRef:
name: ansibleawsconfig

Environment :-
collections:
- name: amazon.aws
source: https://galaxy.ansible.com
version: "5.4.0"
python version : Python 3.9.16
ansible==8.0.0
ansible-core==2.15.0
boto3==1.26.145
botocore==1.29.145

@Teja446 Teja446 added the bug Something isn't working label Jun 2, 2023
@Teja446
Copy link
Author

Teja446 commented Jun 2, 2023

Requesting to provide the document/guide and examples to perform ansible playbook tasks in amazon.aws and gcp.cloud cloud collections using upbound ansible provider , so that it will be helpful to explore more into upbound ansible provider .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant