Update 2 files

- /home/dot_local/bin/executable_install-program
- /home/.chezmoiscripts/universal/run_onchange_after_11-symlink-ansible-roles.tmpl
This commit is contained in:
Brian Zalewski 2023-01-09 05:42:32 +00:00
parent 255fe69345
commit 7438c9c839
2 changed files with 7 additions and 4 deletions

View file

@ -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

View file

@ -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`)