DEV Community

Büşra
Büşra

Posted on

Ubuntu 22.04'de Ansible Kurulumu ve Örnek Playbook Repositorie

  • sudo apt güncelleme -y && sudo apt yükseltme -y
  • sudo apt install ansible sshpass -y
  • sudo nano /etc/ansible/hosts
[servers]
server1 ansible_host=192.168.56.103
server2 ansible_host=192.168.56.105

[all:vars]
ansible_python_interpreter=/usr/bin/python3
Enter fullscreen mode Exit fullscreen mode
  • ansible-envanter --list -y

Image description

  • sudo nano /etc/ansible/ansible.cfg
[defaults]
host_key_checking = False
ansible_user = sysadmin
ask_pass = True
ask_become_pass = True
Enter fullscreen mode Exit fullscreen mode
  • Ping Test:

ansible all -m ping -u sysadmin --ask-pass

Image description

  • Run Command Playbooks:

ansible-playbook -i /etc/ansible/hosts ymlname.yml --ask-pass --ask-become-pass

Top comments (0)