diff --git a/install.sh b/install.sh index 30f57ebc2..5ff21ac82 100755 --- a/install.sh +++ b/install.sh @@ -193,7 +193,6 @@ ce_provision: repo: https://github.com/vlcty/ansible-systemd-timers.git branch: master galaxy_custom_requirements_file: "" - galaxy_installation_path: "/home/{{ _ce_provision_username }}/.ansible/collections/ansible_collections" upgrade_galaxy: enabled: true command: "/home/${CONTROLLER_USER}/ce-python/bin/ansible-galaxy collection install --force" diff --git a/roles/debian/ce_deploy/defaults/main.yml b/roles/debian/ce_deploy/defaults/main.yml index 061e08fc6..dfccea372 100644 --- a/roles/debian/ce_deploy/defaults/main.yml +++ b/roles/debian/ce_deploy/defaults/main.yml @@ -26,9 +26,7 @@ ce_deploy: groups: [] # File containing default roles and collections to install via Ansible Galaxy. # Roles will be installed to $HOME/.ansible/roles for the provision user. This roles path should be added to your ansible.cfg file. - # Collections will be installed to $HOME/.ansible/collections for the provision user. This collections path should also be added to your ansible.cfg file. galaxy_custom_requirements_file: "/home/{{ _ce_deploy.username }}/ce-deploy/config/files/galaxy-requirements.yml" - galaxy_installation_path: "/home/{{ _ce_deploy.username }}/.ansible/collections/ansible_collections" upgrade_galaxy: enabled: true command: "{{ _venv_path }}/bin/ansible-galaxy collection install --force" # _venv_path in the _init role - must match ce_deploy.venv_path if overridden diff --git a/roles/debian/ce_deploy/tasks/main.yml b/roles/debian/ce_deploy/tasks/main.yml index 1edcc7007..447cd99c1 100644 --- a/roles/debian/ce_deploy/tasks/main.yml +++ b/roles/debian/ce_deploy/tasks/main.yml @@ -183,13 +183,13 @@ - name: Install mandatory ansible-galaxy roles and collections. ansible.builtin.command: - cmd: "{{ _venv_path }}/bin/ansible-galaxy install -p {{ ce_deploy.galaxy_installation_path }} -r {{ ce_deploy.local_dir }}/requirements-{{ ansible_distribution_major_version }}.yml --force" + cmd: "{{ _venv_path }}/bin/ansible-galaxy install -r {{ ce_deploy.local_dir }}/requirements-{{ ansible_distribution_major_version }}.yml --force" become: true become_user: "{{ ce_deploy.username }}" - name: Install custom ansible-galaxy roles and collections. ansible.builtin.command: - cmd: "{{ _venv_path }}/bin/ansible-galaxy install -p {{ ce_deploy.galaxy_installation_path }} -r {{ ce_deploy.galaxy_custom_requirements_file }} --force" + cmd: "{{ _venv_path }}/bin/ansible-galaxy install -r {{ ce_deploy.galaxy_custom_requirements_file }} --force" become: true become_user: "{{ ce_deploy.username }}" when: _ce_deploy_custom_galaxy_requirements.stat.exists @@ -208,7 +208,7 @@ vars: timers: upgrade_ce_deploy_ansible_galaxy_mandatory: - timer_command: "{{ ce_deploy.upgrade_galaxy.command }} -p {{ ce_deploy.galaxy_installation_path }} -r {{ ce_deploy.local_dir }}/requirements-{{ ansible_distribution_major_version }}.yml" + timer_command: "{{ ce_deploy.upgrade_galaxy.command }} -r {{ ce_deploy.local_dir }}/requirements-{{ ansible_distribution_major_version }}.yml" timer_user: "{{ ce_deploy.username }}" timer_OnCalendar: "{{ ce_deploy.upgrade_galaxy.on_calendar }}" when: ce_deploy.upgrade_galaxy.enabled @@ -219,7 +219,7 @@ vars: timers: upgrade_ce_deploy_ansible_galaxy_custom: - timer_command: "{{ ce_deploy.upgrade_galaxy.command }} -p {{ ce_deploy.galaxy_installation_path }} -r {{ ce_deploy.galaxy_custom_requirements_file }}" + timer_command: "{{ ce_deploy.upgrade_galaxy.command }} -r {{ ce_deploy.galaxy_custom_requirements_file }}" timer_user: "{{ ce_deploy.username }}" timer_OnCalendar: "{{ ce_deploy.upgrade_galaxy.on_calendar }}" when: diff --git a/roles/debian/ce_provision/defaults/main.yml b/roles/debian/ce_provision/defaults/main.yml index 59ff8bc78..863be9952 100644 --- a/roles/debian/ce_provision/defaults/main.yml +++ b/roles/debian/ce_provision/defaults/main.yml @@ -37,9 +37,7 @@ ce_provision: branch: master # File containing default roles and collections to install via Ansible Galaxy. # Roles will be installed to $HOME/.ansible/roles for the provision user. This roles path should be added to your ansible.cfg file. - # Collections will be installed to $HOME/.ansible/collections for the provision user. This collections path should also be added to your ansible.cfg file. galaxy_custom_requirements_file: "/home/{{ _ce_provision_username }}/ce-provision/config/files/galaxy-requirements.yml" - galaxy_installation_path: "/home/{{ _ce_provision_username }}/.ansible/collections/ansible_collections" upgrade_galaxy: enabled: true command: "{{ _venv_path }}/bin/ansible-galaxy collection install --force" # _venv_path in the _init role - must match ce_provision.venv_path if overridden diff --git a/roles/debian/ce_provision/tasks/main.yml b/roles/debian/ce_provision/tasks/main.yml index 9dab0d778..d81941702 100644 --- a/roles/debian/ce_provision/tasks/main.yml +++ b/roles/debian/ce_provision/tasks/main.yml @@ -226,13 +226,13 @@ - name: Install mandatory ansible-galaxy roles and collections. ansible.builtin.command: - cmd: "{{ _venv_path }}/bin/ansible-galaxy install -p {{ ce_provision.galaxy_installation_path }} -r {{ ce_provision.local_dir }}/roles/debian/ce_provision/meta/requirements-{{ ansible_distribution_major_version }}.yml --force-with-deps" + cmd: "{{ _venv_path }}/bin/ansible-galaxy install -r {{ ce_provision.local_dir }}/roles/debian/ce_provision/meta/requirements-{{ ansible_distribution_major_version }}.yml --force-with-deps" become: true become_user: "{{ ce_provision.username }}" - name: Install custom ansible-galaxy roles and collections. ansible.builtin.command: - cmd: "{{ _venv_path }}/bin/ansible-galaxy install -p {{ ce_provision.galaxy_installation_path }} -r {{ ce_provision.galaxy_custom_requirements_file }}" + cmd: "{{ _venv_path }}/bin/ansible-galaxy install -r {{ ce_provision.galaxy_custom_requirements_file }}" become: true become_user: "{{ ce_provision.username }}" when: _ce_provision_custom_galaxy_requirements.stat.exists @@ -243,7 +243,7 @@ vars: timers: upgrade_ce_provision_ansible_galaxy_mandatory: - timer_command: "{{ ce_provision.upgrade_galaxy.command }} -p {{ ce_provision.galaxy_installation_path }} -r {{ ce_provision.local_dir }}/roles/debian/ce_provision/meta/requirements-{{ ansible_distribution_major_version }}.yml" + timer_command: "{{ ce_provision.upgrade_galaxy.command }} -r {{ ce_provision.local_dir }}/roles/debian/ce_provision/meta/requirements-{{ ansible_distribution_major_version }}.yml" timer_user: "{{ ce_provision.username }}" timer_OnCalendar: "{{ ce_provision.upgrade_galaxy.on_calendar }}" when: ce_provision.upgrade_galaxy.enabled @@ -254,7 +254,7 @@ vars: timers: upgrade_ce_provision_ansible_galaxy_custom: - timer_command: "{{ ce_provision.upgrade_galaxy.command }} -p {{ ce_provision.galaxy_installation_path }} -r {{ ce_provision.galaxy_custom_requirements_file }}" + timer_command: "{{ ce_provision.upgrade_galaxy.command }} -r {{ ce_provision.galaxy_custom_requirements_file }}" timer_user: "{{ ce_provision.username }}" timer_OnCalendar: "{{ ce_provision.upgrade_galaxy.on_calendar }}" when: