If you just want to install a bunch of packages a simple one-liner could do like: sudo bash -c 'for package in "tmux" "htop" "gimp" do apt install -y -no-upgrade "$package" done' This only scratches the surface, Ansible has an extensive module collection. (The fact, that the hostname myhost is twice in the command-line, because we are not using a fixed host inventory list, but an ad-hoc one, with the trailing comma.) The list "tcpdump,tmux" can be extended with commas. chef is also on the scene.Īnsible example for hostname myhost, module apt (replace with yum or whatever): ansible -K -i myhost, -m apt -a "name=tcpdump,tmux state=present" -become myhost Some say "more complex, but maybe just right.". Reading about ansible should give you vocabulary to search for the others, and compare, if needed. There are several others in the same category. It includes its own declarative language to describe system configuration It runs on many Unix-like systems, and can configure both Unix-like systems as well as Microsoft Windows. Refer to the aptitude user's manual for details.Īnsible is an open-source software provisioning, configuration management, and application-deployment tool. Use the commands mentioned above for installing the packages from this list. LC_ALL=C ensures that all output is done in English without translation to a native language. For each matching package the package name ( %p) and the status ( %C) will be printed (this mimics the output of dpkg -get-selections). This will search all packages that are installed ( ~i) and not ( !) flagged automatic ( ~M). Sudo dpkg -set-selections my_package_list.txt On Debian/Ubuntu based systems you can dump the list of installed packages to a file dpkg -get-selections > my_package_list.txtĪnd install them again by running apt-cache dumpavail | sudo dpkg -merge-avail
0 Comments
Leave a Reply. |