Skip to content

Instantly share code, notes, and snippets.

@flrichar
Last active December 30, 2021 17:07
Show Gist options
  • Select an option

  • Save flrichar/7df9b6075cd89d7b8bbcc26881c18a87 to your computer and use it in GitHub Desktop.

Select an option

Save flrichar/7df9b6075cd89d7b8bbcc26881c18a87 to your computer and use it in GitHub Desktop.
yay function on all linux-nodes
## 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