-
Feature Request
-
Resolution: Unresolved
-
Undefined
-
None
-
2.5
-
False
-
-
False
- The installer should support configurable commands to adjust ownership and permissions for the hub_data_dir directory after mounting NFS shares. This would prevent errors like:
TASK [ansible.containerized_installer.automationhub : Create automation hub subdirectories] failed: [ip-172-31-33-69.ap-southeast-2.compute.internal] (item=.gnupg) => {"msg": "There was an issue creating /home/ec2-user/aap/hub/data/.gnupg as requested: [Errno 13] Permission denied: b'/home/ec2-user/aap/hub/data/.gnupg'"}
For example, I wanted to benefit from the installer-supported variables, using my AWS EFS share:
hub_shared_data_path=fs-066c8dc519a1e08a7.efs.ap-southeast-2.amazonaws.com:/ hub_shared_data_mount_opts=nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport
I can see the code of the installer ( from .../aap-25_6-cont-setup-bundle/collections/ansible_collections/ansible/containerized_installer/roles/automationhub/tasks/nfs.yml ):
- name: Mount the NFS Share ... - name: Create automation hub subdirectories
Which makes the permissions on the "/home/ec2-user/aap/hub/data/" to NOT allow the "ec2-user" write there:
[ec2-user@ip-172-31-43-80 data]$ ls -la /home/ec2-user/aap/hub/data/ total 4 drwxr-xr-x. 2 root root 6144 Dec 10 02:27 .
- Why does the customer need this? (List the business requirements here)
Streamlined Installation: Automating the adjustment of permissions eliminates manual steps, ensuring a smoother and faster installation process.
Consistency: Ensures consistent permissions and ownership settings across installations, improving reliability in distributed environments.
Ease of Use: Allows users to define custom commands in the inventory file, catering to varied organizational policies and storage setups.
- How would you like to achieve this? (List the functional requirements here)
- Add a task to the installer (nfs.yml) to execute custom shell commands on the hub_data_dir directory after mounting the NFS share. - Introduce a new inventory variable (e.g., hub_data_dir_extras) to allow users to define a list of commands for adjusting permissions and ownership. - Update the existing workflow as follows: Check if hub_data_dir_extras is defined in the inventory file. Loop through and execute the commands defined in hub_data_dir_extras with ansible.builtin.shell. Apply changes only when necessary to avoid redundant executions. - Provide documentation for using the new inventory variable with examples of common configurations.
Example:
Example configuration: [automationhub:vars] hub_data_dir_extras=[ "chown root:ec2-user {{ hub_data_dir }}", "chmod 0775 {{ hub_data_dir }}" ] Example task in nfs.yml: - name: Apply extra commands for hub data directory ansible.builtin.shell: "{{ item }}" loop: "{{ hub_data_dir_extras }}" become: true when: hub_data_dir_extras is defined and hub_data_dir_extras | length > 0
- List any affected known dependencies: Doc, UI etc..
Documentation: Update to include hub_data_dir_extras with examples for NFS setups.
Installer Code: Update nfs.yml in the containerized installer.
- Github Link if any