====== Ansible ====== **AUTOMATION FOR EVERYONE**\\ Deploy apps. Manage systems. Crush complexity.\\ Ansible helps you build a strong foundation for DevOps\\ **Homepage:** http://www.ansible.com/\\ **Doc:** http://docs.ansible.com/ https://galaxy.ansible.com/ ===== Instalace ===== shell# yum install epel-release shell# yum update shell# yum install ansible shell# ansible --version shell# yum install git ===== Nastavení ===== # This is the default ansible 'hosts' file. # # It should live in /etc/ansible/hosts # # - Comments begin with the '#' character # - Blank lines are ignored # - Groups of hosts are delimited by [header] elements # - You can enter hostnames or ip addresses # - A hostname/ip can be a member of multiple groups # Ex 1: Ungrouped hosts, specify before any group headers. localhost ansible_connection=local ===== Příkazy ===== Spustí se modul ping na localhostu shell# ansible -m ping localhost Spustí se modul ping na všechny stroje v inventory se spoustou detailů shell# ansible -m ping all -vvv Spustí se modul ping s argumentem pwd na všechny stroje v inventory shell# ansible -m shell -a pwd all Spustí se modul yum, s parametry název balíček moon-buggy, stav installed (chci aby byl ve stavu nainstalován), repozitář epel a na všechny stroje v inventory shell# ansible -m yum -a 'name=moon-buggy state=installed enablerepo=epel' all Spustí se modul yum, s parametry název balíček moon-buggy, stav absent (chci aby byl ve stavu nenainstalován), repozitář epel a na všechny stroje v inventory shell# ansible -m yum -a 'name=moon-buggy state=absent enablerepo=epel' all ===== Inventory ===== * seznamy spravovaných počítačů * výchozí konfigurace v /etc/ansible/hosts * je možné je dynamicky generovat ===== Moduly ===== * http://docs.ansible.com/ansible/list_of_all_modules.html ===== Playbook =====