Ansible Tutorial - Package Management | Ansible Module YUM | APT

Linuxtopic
0



ansible module, ansible ad-hoc command, ansible yum module, ansible apt module, ansible tutorial

tags: ansible ad-hoc command, ansible yum module, ansible apt module, working with ansible module 

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




ansible module, ansible ad-hoc command, ansible yum module, ansible apt module



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"


ansible module, ansible ad-hoc command, ansible yum module, ansible apt module



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








Post a Comment

0Comments

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Ok, Go it!