Hi, im trying to selfhost forem on AWS.
After configuring everything, im trying to run ansible-playbook -i inventory/forem/setup.yml playbooks/providers/aws.yml
, but its giving me the following error:
❯ ansible-playbook -i inventory/forem/setup.yml playbooks/providers/aws.yml
ERROR! couldn't resolve module/action 'amazon.aws.ec2'. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in '/home/sln/Downloads/selfhost/playbooks/providers/aws.yml': line 170, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: "Launch Forem instance for {{ app_domain }}"
^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:
with_items:
- {{ foo }}
Should be written as:
with_items:
- "{{ foo }}"
The aws credentials are good. Not really sure what the issue.
In one of the issue i found that passing the vpc id might fix the issue and i tried. Still the same error occurs(My AWS account has only one VPC i.e, the default VPC). The IAM aswell has the fullaccess permissions - AmazonEC2FullAccess, AmazonS3FullAccess, AmazonVPCFullAccess.
Any help or sugggestions are appreciated.
Thank you
Top comments (9)
The values of the vault secrets in the setup.yml inventory must have indentations like the commented ones. Can you try after checking these values again.
Example:
Yes, i have added indentations.
However, the error persists.
The error message says the error appears to be in '/home/sln/Downloads/selfhost/playbooks/providers/aws.yml': line 170, column 7. Have you modified this file?
If you cannot find the error in this file, can you share the file with me?
Yes. I modified this file and modified the following keys:
This is file
/home/sln/Downloads/selfhost/playbooks/providers/aws.yml
This is the output of the ansible-playbook command when run in verbose mode -
I couldn't find any problem in your aws.yml file. However, the problem might be in the setup.yml file. There should be a misspelling.
You can follow this path to catch the error:
Thanks for the help. Will try those. Since im trying forem.dev for the first time, i am facing such issues.
Hi Muhammed Cetin
I tried the used original aws.yml file but still getting the same error.
I am using ubuntu to deploy forem. According the the docs, i need to install butane, but not able to install butane in ubuntu. Is there any way to install it or other ways to delploy with production settings?
I tried the development version of the forem by installing ruby and other packages locally, it worked fine and was able to run it successfully.
Please do advice the process to deploy forem from ubuntu is different or do i need to stick to the developer documentation.
Was able to fix those errors after updating the aws.yml and referred this while updating - docs.ansible.com/ansible/latest/co...