Last active
December 30, 2021 17:07
-
-
Save flrichar/7df9b6075cd89d7b8bbcc26881c18a87 to your computer and use it in GitHub Desktop.
yay function on all linux-nodes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## crate a cluster-wide alias to normalize yay command | |
| ## set alias in .bashrc on every linux-node, access with tf remote-exec or ansible shell module | |
| ## alias for login user w/ sudo, as root with just the command | |
| ## ex, arch is just 'yay', debian-based is 'apt-get upgrade', tumbleweed/leap/sles is 'zypper up --details', | |
| ## micro is 'transactional-update up -d -n' | |
| ## rhel,centos is 'dnf upgrade -v' or 'yum upgrade -v' | |
| ## check for existence | |
| ansible devx -b -e @path/vars/become.yaml -m shell -a 'grep yay ~/.bashrc' | |
| ## call bash alias remotely | |
| ansible devx -b -e @path/vars/become.yaml -m shell -a 'bash -i -c yay' | |
| ## separate function to update repo info on each distro |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment