Ansible Kullanma Kilavuzu
|
#SSH Kurulumu
apt-get install openssh-server
|
|
#SSH Key'i oluşturma
ssh-keygen
|
|
#SSH Keyini Nodelara Aktarma
ssh-copy-id <server-ip>
|
|
#Repoları Ekleme
$ sudo apt-add-repository ppa:ansible/ansible
|
|
#Repolari Guncelleme
$ sudo apt-get update
|
|
#Ansible Kurulumu
$ sudo apt-get install ansible
|
|
#Versiyon Kontrolu
$ ansible --version
|
|
#Sunuculara Ping Gonderme
|
$ ansible –m ping <hosts>
|
|
#Dosyayi sunuculara kopyalama
|
$ ansible <host> -m copy -a 'src=./dosya/ dest=/tmp/dosya'
|
|
#Sunuculardan Dosya Silme
|
$ ansible <hosts> -m file -a 'dest=/silinecek/dosya state=absent
|
|
Playbook formati .yaml ya da .yml olmalidir.
|
nano ornek-playbook.yaml
|
|
playbook calistirmak
|
ansible-playbook ornek-playbook.yaml
|
|
all
|
Host dosyasinda bulunan sunucularin hepsi
|
|
*
|
Host dosyasinda bulunan sunucularin hepsi
|
|
10.0.0.*
|
10.0.0 ile baslayan butun ipler
|
|
sunucular:istanbul
|
sunucular ve istanbul blogu icerisinde olanlar
|
|
Apache Kurulumu
|
ansible <sunucu> -m apt -a 'name=apache2 state=present'
|
|
Nginx Kurulumu
|
ansible <sunucu> -m apt -a 'name=nginx state=present'
|
|
Mysql Kurulumu
|
ansible <sunucu> -m apt -a 'name=mysql-server state=present'
|
|
PHP Kurulumu
|
ansible <sunucu> -m apt -a 'name=php7.0 state=present'
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.