Update 3 files

- /home/dot_local/bin/executable_install-program
- /home/.chezmoiscripts/universal/run_onchange_after_11-symlink-ansible-roles.tmpl
- /software.yml
This commit is contained in:
Brian Zalewski 2022-12-25 14:00:18 +00:00
parent 1e43707aa6
commit 141ef1ec90
3 changed files with 68 additions and 25 deletions

View file

@ -10,7 +10,7 @@
{{ end -}} {{ end -}}
{{- end }} {{- end }}
logg 'Ensuring Gas Station roles are symlinked to ~/.local/share/ansible/roles' logg info 'Ensuring Gas Station roles are symlinked to ~/.local/share/ansible/roles'
mkdir -p "$XDG_DATA_HOME/ansible/roles" mkdir -p "$XDG_DATA_HOME/ansible/roles"
find "$HOME/.local/src/gas-station/roles" -mindepth 2 -maxdepth 2 -type d | while read ROLE_PATH; do find "$HOME/.local/src/gas-station/roles" -mindepth 2 -maxdepth 2 -type d | while read ROLE_PATH; do
ROLE_FOLDER="professormanhattan.$(echo "$ROLE_PATH" | sed 's/.*\/\([^\/]*\)$/\1/')" ROLE_FOLDER="professormanhattan.$(echo "$ROLE_PATH" | sed 's/.*\/\([^\/]*\)$/\1/')"
@ -24,3 +24,6 @@ find "$HOME/.local/src/gas-station/roles" -mindepth 2 -maxdepth 2 -type d | whil
ln -s "$ROLE_PATH" "$XDG_DATA_HOME/ansible/roles/$ALT_ROLE_FOLDER" ln -s "$ROLE_PATH" "$XDG_DATA_HOME/ansible/roles/$ALT_ROLE_FOLDER"
fi fi
done done
logg info 'Ensuring Ansible Galaxy collections are installed'
ansible-galaxy install -r "$HOME/.local/src/gas-station/requirements.yml"

View file

@ -91,15 +91,20 @@ async function downloadInstallData() {
} }
// Creates the installOrders object which maps package managers to arrays of packages to install // Creates the installOrders object which maps package managers to arrays of packages to install
let generateInstallOrderCount = 0
const installerPreference = await OSTypeInstallerKey()
const preferenceOrder = installData.installerPreference[installerPreference]
async function generateInstallOrders(pkgsToInstall) { async function generateInstallOrders(pkgsToInstall) {
const logStage = 'Install Orders' const logStage = 'Install Orders'
const packagesToInstall = pkgsToInstall const packagesToInstall = pkgsToInstall
const installerPreference = await OSTypeInstallerKey() const softwarePackages = installData.softwarePackages
if (generateInstallOrderCount === 0) {
log('info', logStage, `Installer preference category detected as ${installerPreference}`) log('info', logStage, `Installer preference category detected as ${installerPreference}`)
const preferenceOrder = installData.installerPreference[installerPreference]
log('info', logStage, `Preference order acquired:`) log('info', logStage, `Preference order acquired:`)
console.log(preferenceOrder) console.log(preferenceOrder)
const softwarePackages = installData.softwarePackages }
generateInstallOrderCount++
log('info', logStage, `New packages discovered for processing: ${pkgsToInstall} (${pkgsToInstall.length} items)`)
pkgFor: for (let pkg of packagesToInstall) { pkgFor: for (let pkg of packagesToInstall) {
let packageKey let packageKey
if (softwarePackages[pkg + ':' + osID]) { if (softwarePackages[pkg + ':' + osID]) {
@ -266,38 +271,38 @@ async function generateInstallOrders(pkgsToInstall) {
if (softwarePackages[packageKey]['_' + currentSelector + ':' + preference + ':' + osID]) { if (softwarePackages[packageKey]['_' + currentSelector + ':' + preference + ':' + osID]) {
pref = preference + ':' + osID pref = preference + ':' + osID
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`)
await installSoftware(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} else if (softwarePackages[packageKey]['_' + currentSelector + ':' + preference + ':' + osType]) { } else if (softwarePackages[packageKey]['_' + currentSelector + ':' + preference + ':' + osType]) {
pref = preference + ':' + osType pref = preference + ':' + osType
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`)
await installSoftware(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osID + ':' + preference]) { } else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osID + ':' + preference]) {
pref = osID + ':' + preference pref = osID + ':' + preference
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`)
await installSoftware(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType + ':' + preference]) { } else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType + ':' + preference]) {
pref = osType + ':' + preference pref = osType + ':' + preference
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`)
await installSoftware(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} }
} else if (scopedPkgManager) { } else if (scopedPkgManager) {
const pref = preference const pref = preference
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`)
await installSoftware(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} else if (scopedSystem) { } else if (scopedSystem) {
let pref let pref
if (softwarePackages[packageKey]['_' + currentSelector + ':' + osID]) { if (softwarePackages[packageKey]['_' + currentSelector + ':' + osID]) {
pref = osID pref = osID
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`)
await installSoftware(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType]) { } else if (softwarePackages[packageKey]['_' + currentSelector + ':' + osType]) {
pref = osType pref = osType
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`) log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.${pref}`)
await installSoftware(softwarePackages[packageKey][pref]) await generateInstallOrders(softwarePackages[packageKey][pref])
} }
} else if (normalCheck) { } else if (normalCheck) {
log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.deps`) log('info', 'Installing Dependencies', `Installing dependencies for ${packageKey}.deps`)
await installSoftware(softwarePackages[packageKey]['_deps']) await generateInstallOrders(softwarePackages[packageKey]['_deps'])
} }
if (softwarePackages[packageKey][preference + ':' + osID]) { if (softwarePackages[packageKey][preference + ':' + osID]) {
await updateInstallMaps( await updateInstallMaps(
@ -333,7 +338,11 @@ async function generateInstallOrders(pkgsToInstall) {
} }
} }
} }
if (generateInstallOrderCount === 1) {
return installOrders return installOrders
} else {
generateInstallOrderCount--
}
} }
// Update install, pre-hook, and post-hook objects // Update install, pre-hook, and post-hook objects
@ -1278,7 +1287,6 @@ async function installSoftware(pkgsToInstall) {
} }
try { try {
for (const key in installOrders) { for (const key in installOrders) {
console.log(key)
installOrders[key] = [...new Set(installOrders[key])] installOrders[key] = [...new Set(installOrders[key])]
} }
log('info', 'Install Orders', `The install orders were generated:`) log('info', 'Install Orders', `The install orders were generated:`)

View file

@ -27,6 +27,7 @@
# _post:brew:debian: | # _post:brew:debian: |
# echo "_post allows you to define a script that runs after the installation" # echo "_post allows you to define a script that runs after the installation"
# _systemd: smbd # System service to enable, restart, and/or start (can also be an array). # _systemd: smbd # System service to enable, restart, and/or start (can also be an array).
# _epel: true # True if https://docs.fedoraproject.org/en-US/epel/ should be enabled
# ansible: professormanhattan.docker # ansible: professormanhattan.docker
# apk: altair # apk: altair
# appimage: https://developers.yubico.com/yubikey-manager-qt/Releases/yubikey-manager-qt-1.2.4b-linux.AppImage # appimage: https://developers.yubico.com/yubikey-manager-qt/Releases/yubikey-manager-qt-1.2.4b-linux.AppImage
@ -2166,7 +2167,7 @@ softwarePackages:
_name: Fuse _name: Fuse
_service: null _service: null
_when:cask: '! test -d /usr/local/Caskroom/macfuse' _when:cask: '! test -d /usr/local/Caskroom/macfuse'
ansible: professormanhattan.fuse ansible:darwin: professormanhattan.fuse
cask: macfuse cask: macfuse
fx: fx:
_bin: fx _bin: fx
@ -2412,11 +2413,16 @@ softwarePackages:
_bin: git-secret _bin: git-secret
_desc: '[git-secret](https://git-secret.io/) is a bash tool to store your private data inside a git repo. Hows that? Basically, it just encrypts, using GPG, the tracked files with the public keys of all the users that you trust. So everyone of them can decrypt these files using only their personal secret key.' _desc: '[git-secret](https://git-secret.io/) is a bash tool to store your private data inside a git repo. Hows that? Basically, it just encrypts, using GPG, the tracked files with the public keys of all the users that you trust. So everyone of them can decrypt these files using only their personal secret key.'
_docs: https://git-secret.io/#commands _docs: https://git-secret.io/#commands
_epel: true
_github: https://github.com/sobolevn/git-secret _github: https://github.com/sobolevn/git-secret
_home: https://git-secret.io/ _home: https://git-secret.io/
_name: Git Secret _name: Git Secret
_service: false _service: false
ansible: professormanhattan.gitsecret ansible:darwin: professormanhattan.gitsecret
ansible:linux: professormanhattan.gitsecret
apt: git-secret
brew: git-secret
dnf: git-secret
gitdock: gitdock:
_bin: null _bin: null
_desc: '[GitDock](https://gitlab.com/mvanremmerden/gitdock) is an app that displays all your GitLab activities in one place. Instead of the GitLab typical project- or group-centric approach, it collects all your information from a user-centric perspective.' _desc: '[GitDock](https://gitlab.com/mvanremmerden/gitdock) is an app that displays all your GitLab activities in one place. Instead of the GitLab typical project- or group-centric approach, it collects all your information from a user-centric perspective.'
@ -2658,6 +2664,7 @@ softwarePackages:
scoop: glow scoop: glow
yay: glow yay: glow
glusterfs: glusterfs:
# TODO - The master / peer logic still needs to be implemented in the .chezmoiscripts
_bin: gluster _bin: gluster
_desc: '[Gluster](https://www.gluster.org/) is a free and open source software scalable network filesystem. Gluster is a software defined distributed storage that can scale to several petabytes. It provides interfaces for object, block and file storage.' _desc: '[Gluster](https://www.gluster.org/) is a free and open source software scalable network filesystem. Gluster is a software defined distributed storage that can scale to several petabytes. It provides interfaces for object, block and file storage.'
_docs: https://docs.gluster.org/en/latest/ _docs: https://docs.gluster.org/en/latest/
@ -2665,7 +2672,9 @@ softwarePackages:
_home: https://www.gluster.org/ _home: https://www.gluster.org/
_name: GlusterFS _name: GlusterFS
_service: true _service: true
_systemd: glusterd
ansible:linux: professormanhattan.glusterfs ansible:linux: professormanhattan.glusterfs
apt: glusterfs-server
dnf: glusterfs-server dnf: glusterfs-server
pacman: glusterfs pacman: glusterfs
gnu: gnu:
@ -4757,7 +4766,7 @@ softwarePackages:
_name: Parallels _name: Parallels
_service: null _service: null
_when: '! test -d "/Applications/Parallels Desktop.app"' _when: '! test -d "/Applications/Parallels Desktop.app"'
ansible: professormanhattan.parallels ansible:darwin: professormanhattan.parallels
pass: pass:
_bin: pass _bin: pass
_desc: Password manager _desc: Password manager
@ -5331,14 +5340,32 @@ softwarePackages:
flatpak: app.resp.RESP flatpak: app.resp.RESP
snap: redis-desktop-manager snap: redis-desktop-manager
recoverpy: recoverpy:
_deps: recoverpy-deps
_bin: recoverpy _bin: recoverpy
_desc: '[RecoverPy](https://eugeny.github.io/recoverpy/) is a highly configurable terminal emulator, SSH and serial client for Windows, macOS and Linux.' _desc: '[RecoverPy](https://github.com/PabloLec/RecoverPy) is a highly configurable terminal emulator, SSH and serial client for Windows, macOS and Linux.'
_docs: null _docs: https://github.com/PabloLec/RecoverPy#usage
_github: null _github: https://github.com/PabloLec/RecoverPy
_home: null _home: https://github.com/PabloLec/RecoverPy
_name: RecoverPy _name: RecoverPy
_service: null _service: false
ansible:linux: professormanhattan.recoverpy ansible:linux: professormanhattan.recoverpy
pipx:linux: recoverpy
recoverpy-deps:
apt:
- coreutils
- grep
- progress
- util-linux
dnf:
- coreutils
- grep
- progress
- util-linux
pacman:
- coreutils
- grep
- progress
- util-linux
remote-desktop: remote-desktop:
_deps: _deps:
- gnome-boxes - gnome-boxes
@ -6662,7 +6689,12 @@ softwarePackages:
_home: null _home: null
_name: Translate Shell _name: Translate Shell
_service: null _service: null
ansible: professormanhattan.translate ansible:darwin: professormanhattan.translate
ansible:linux: professormanhattan.translate
apt: translate-shell
brew: translate-shell
dnf: translate-shell
pacman: translate-shell
tree: tree:
_bin: tree _bin: tree
_desc: '[tree-cli](https://github.com/MrRaindrop/tree-cli) is a recursive directory listing program that produces a depth indented listing of files. With no arguments, tree lists the files in the current directory. When directory arguments are given, tree lists all the files and/or directories found in the given directories each in turn. Upon completion of listing all files/directories found, tree returns the total number of files and/or directories listed.' _desc: '[tree-cli](https://github.com/MrRaindrop/tree-cli) is a recursive directory listing program that produces a depth indented listing of files. With no arguments, tree lists the files in the current directory. When directory arguments are given, tree lists all the files and/or directories found in the given directories each in turn. Upon completion of listing all files/directories found, tree returns the total number of files and/or directories listed.'