diff --git a/home/.chezmoiscripts/universal/run_onchange_after_11-symlink-ansible-roles.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_11-symlink-ansible-roles.tmpl index 1be892bc..c70028d3 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_11-symlink-ansible-roles.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_11-symlink-ansible-roles.tmpl @@ -28,7 +28,8 @@ done if [ -f "$HOME/.local/src/gas-station/requirements.yml" ]; then if command -v ansible-galaxy > /dev/null; then logg info 'Ensuring Ansible Galaxy collections are installed' - ansible-galaxy install -r "$HOME/.local/src/gas-station/requirements.yml" || EXIT_CODE=$? + export ANSIBLE_CONFIG="$HOME/.local/share/ansible/ansible.cfg" + ansible-galaxy install -r "$HOME/.local/share/ansible/requirements.yml" || EXIT_CODE=$? if [ -n "$EXIT_CODE" ]; then logg error 'Failed to install Ansible requirements from Ansible Galaxy' if [ -d "$HOME/.local/src/gas-station/collections" ]; then @@ -38,11 +39,13 @@ if [ -f "$HOME/.local/src/gas-station/requirements.yml" ]; then if [ -n "$SECOND_EXIT_CODE" ]; then logg error 'Failed to install requirements from both the cloud and the local copy' && exit 1 fi + else + logg warn '~/.local/src/gas-station/collections is missing' fi fi else logg warn 'Unable to install the Ansible Galaxy requirements.yml since the ansible-galaxy executable is missing from the PATH' fi else - logg warn '~/.local/src/gas-station/requirements.yml is missing' + logg warn '~/.local/share/ansible/requirements.yml is missing' fi diff --git a/home/dot_local/bin/executable_install-program b/home/dot_local/bin/executable_install-program index 1fd77e14..6774d496 100644 --- a/home/dot_local/bin/executable_install-program +++ b/home/dot_local/bin/executable_install-program @@ -626,7 +626,7 @@ async function beforeInstall(packageManager) { if (unbuffer) { unbufferPrefix = 'unbuffer' } - await $`${unbufferPrefix} ansible 127.0.0.1 -vv -e '{ ansible_connection: "local", ansible_become_user: "${process.env.USER}", ansible_user: "${process.env.USER}", install_homebrew: False }' -m setup` + await $`ANSIBLE_CONFIG=${process.env.HOME}/.local/share/ansible/ansible.cfg ${unbufferPrefix} ansible 127.0.0.1 -vv -e '{ ansible_connection: "local", ansible_become_user: "${process.env.USER}", ansible_user: "${process.env.USER}", install_homebrew: False }' -m setup` } else if (packageManager === 'apk') { await $`sudo apk update` } else if (packageManager === 'apt') { @@ -1084,7 +1084,7 @@ async function installPackageList(packageManager, packages) { unbufferPrefix = 'unbuffer' } const verboseMode = process.env.DEBUG_MODE === 'on' ? 'vv' : '' - await $`ansible 127.0.0.1 -v${verboseMode} -e '{ ansible_connection: "local", ansible_become_user: "root", ansible_user: "${process.env.USER}", install_homebrew: False }' -m include_role -a name=${pkg}` + await $`ANSIBLE_CONFIG=${process.env.HOME}/.local/share/ansible/ansible.cfg ansible 127.0.0.1 -v${verboseMode} -e '{ ansible_connection: "local", ansible_become_user: "root", ansible_user: "${process.env.USER}", install_homebrew: False }' -m include_role -a name=${pkg}` log('success', 'Install', `${pkg} successfully installed via ${packageManager}`) } catch (e) { log('error', 'Install Failure', `There was an error installing ${pkg} with Ansible`)