Ansible Module : Yum
Package manager for rpm family to Installs, upgrade, downgrades, removes, and lists packages and groups
To help about yum module
ansible-doc yum
Practice of yum module
Check if package is installed & update it
ansible 172.17.20.98 -m yum -a "name=vsftpd state=latest"
Check if package is installed & don’t update it
ansible 172.17.20.98 -m yum -a "name=vsftpd state=present"
Check if package is at a specific version
ansible 172.17.20.98 -m yum -a "name=vsftpd-3.0.2 state=present"
Install package from particular repo
ansible 172.17.20.98 -m yum -a "name=vsftpd state=installed disablerepo=* enablerepo=epel"
Video Tutorial :
Search Package
ansible 172.17.20.98 -m yum -a "list=available" | grep squid
check installed package
ansible 172.17.20.98 -m yum -a "list=installed" | grep squid
remove package
ansible 172.17.20.98 -m yum -a "name=vsftpd state=absent"
All Module Option:
allow_downgrade
autoremove
bugfix
conf_file
disable_excludes
disable_gpg_check
disable_plugin
disablerepo
download_only
enable_plugin
enablerepo
exclude
installroot
list
name
releasever
security
skip_broken
state
update_cache
update_only
use_backend
validate_certs
Apt - Module
Manages `apt' packages such like Ubuntu or Debian
Get help of apt module, just type below command
ansible-doc apt
Practice of apt module
Update cache
ansible 172.17.20.98 -m apt -a "update_cache=yes"
Check if package is installed & update it
ansible 192.168.3.104 -m apt -a "name=vsftpd state=latest"
Check if package is at a specific version
ansible 172.17.20.98 -m apt -a "name=vsftpd-3.0.2 state=present"
All Module Option:
allow_unauthenticated
autoclean
autoremove
cache_valid_time
deb
default_release
dpkg_options
force
force_apt_get
install_recommends
name
only_upgrade
purge
state
update_cache
upgrade
Thanks
End of this ansble tutorial- ansible systemd module and ansible service module, we need your support so i request you to please comment, share and like this post
www.linuxtopic.com