Closed idNoRD closed 1 month ago
The solution will be in line with how the other middleware_automation collections behave (override a default parameter, otherwise read PWD)
When I run without sudo it works
sudo /opt/ansible/bin/ansible-playbook -c local -i localhost, keycloak_playbook.yml
~sudo~
I'd strongly advise NOT to run ansible-playbook with privileges, it is supposed to escalate when necessary on the other side (which is valid also when target is localhost). Why don't you try the install on a podman or docker container instead?
The molecule test scenarios are friendly pre-setup environments that can be used for evaluation/development/testing
I am trying to run ansible playbook on AWS EC2 instance from userdata script for production environment. Initially I run docker container with keycloak on EC2 but as I understand for production it's necessary to run it in rootless mode which may have slow network or other issues. Also docker consumes extra resources and needs extra maintenance/security so I just switched to this ansible playbook.
Regarding default download destination folder it can be /tmp with a task that verifies access to it. Example:
- name: Ensure correct permissions on temporary directories
file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: "1777"
loop:
- /tmp
SUMMARY
"Download keycloak archive" task fails because of local_path.stat.path doesn't exists Ensure you are explicitly retrieving the current working directory without relying on environment variables
ISSUE TYPE
ANSIBLE VERSION
COLLECTION VERSION
STEPS TO REPRODUCE
EXPECTED RESULTS
I expected this task to get current dir properly and download keycloak archive successfully without any errors
As a solution I propose to replace this block:
with this new way of getting current directory:
ACTUAL RESULTS
Got this error:
Then I've added debug for local_path
sudo vi /root/.ansible/collections/ansible_collections/middleware_automation/keycloak/roles/keycloak_quarkus/tasks/install.yml
and got this output which shows that the local_path stat doesn't exist