Open kdjomeda opened 3 months ago
Hi @kdjomeda does it work by using ansible-playbook
? It is not looks like Semaphore issue because python was found correctly.
@kdjomeda in your setup description you use AWS profile devops
but in Ansible you use profile prod-uat-example
. Is it correct? Can you try global_var_profile=devops
?
Sorry that was a way of showing that profile was set up and operational. There are multiple profiles in there
I am going to give it a try. I edited the profile to be prod-uat-example because it will reveal the product name. it is originally product-
@fiftin I did run it directly on the device and it run but not on the semaphoreui
Hm, it is really strange. @tboerger, @andreas-marschke do you have any idea?
I don't have an idea really... I never used profiles.
@kdjomeda Looks like I understood why it can't find your profile. Because Semaphore override HOME environment variable. Please try following config which I got from ChatGPT:
- name: Launch EC2 instance
hosts: localhost
gather_facts: no
environment:
AWS_PROFILE: your-custom-profile-name
AWS_CONFIG_FILE: /path/to/your/custom/config
AWS_SHARED_CREDENTIALS_FILE: /path/to/your/custom/credentials
tasks:
- name: Create an EC2 instance
ec2:
key_name: my-key
instance_type: t2.micro
image: ami-12345678
region: us-east-1
wait: yes
register: ec2
- debug:
var: ec2
Sorry for the late revert. The passing of the AWS_PROFILE, the AWS_CONFIG, and the credentials files have been done but it didn't change much on the outcome . The profile still remained not found. Besides that, this customisation or feeding in of the various environment variables inside the playbooks a is a little bit of a turn off for us. This will cause a lot of rewrite . 90% of our workload runs on AWS. So the profile is a key feature for us to use the semaphore ui. @fiftin
Hello Community,
I have run into issues trying to execute ansible-semaphoreui with AWS profiles. There are 2 issues in one:
Setup used ubuntu 22.04 LTS on AWS EC2
My task template is as follows
with the CLI args
["-e","global_var_environment=prod","-e", "global_var_profile=prod-uat-example","-vvvv"]
I had to pass the aws profile as a extra argument passed to ansible playbook shown below:
The default value is to pick it from the command line environment variable if I am able to set one
When I execute a task on it in debug mode the output is this
Grateful if anyone can share their wisdom on this. Been blocked at this since 24th April 2024. I think I have run out of options and wanted to check with the community if there is something I needed to change or some understanding I don't have yet. Thanks in advance