Ana içeriğe geç

Ansible ile wordpress kurulumu

Nedir?

  • Bu dökümantasyonda ansible ile yönettiğiniz makinelere tek komutla wordpress kurulumu yapabileceksiniz

Gereklilikler

ansible ile wordpress kurmak için gerekli yapılandırmalar

  • git indiriyoruz
yum install git
  • git üzerinden gerekli dosyaları çekiyoruz
git clone https://github.com/koraykutanoglu/anspress
  • Wordpress ayarlarının düzenlenmesi için ayar dosyası açılıyor
nano vars/default.yml
  • çıktı:
#System Settings
php_modules: [ 'php-curl', 'php-gd', 'php-mbstring', 'php-xml', 'php-xmlrpc', 'php-s$

#MySQL Settings
mysql_root_password: "root"
mysql_db: "wordpress"
mysql_user: "sammy"
mysql_password: "password"

#HTTP Settings
http_host: "your_domain"
http_conf: "your_domain.conf"
http_port: "80"
  • php_modules: WordPress kurulumunuzu desteklemek için yüklenmesi >
  • mysql_root_password: Kök MySQL hesabı için istenen şifre .
  • mysql_db: WordPress için oluşturulması gereken MySQL veritabanın>
  • mysql_password: Yeni MySQL kullanıcısı için şifre.
  • http_host: Alan adınız.
  • http_conf: Apache içinde oluşturulacak yapılandırma dosyasının a>- http_port: Bu sanal ana bilgisayar için HTTP bağlantı noktası, b>

Ansible ile wordpress kurma testi

  • Ansible ile bağlı makinelere wordpress kurulumu yapıyoruz
  • linux adı hosts dosyasında bulunan addır
  • root ise server kullanıcı adıdır
ansible-playbook playbook.yml -l linux -u root
  • çıktı:
PLAY [all] **************************************************************************
TASK [Gathering Facts] **************************************************************ok: [192.168.127.147]
TASK [Install prerequisites] ********************************************************changed: [192.168.127.147]
TASK [Install LAMP Packages] ********************************************************changed: [192.168.127.147] => (item=apache2)
changed: [192.168.127.147] => (item=mysql-server)
changed: [192.168.127.147] => (item=python3-pymysql)
changed: [192.168.127.147] => (item=php)
changed: [192.168.127.147] => (item=php-mysql)
changed: [192.168.127.147] => (item=libapache2-mod-php)
TASK [Install PHP Extensions] *******************************************************changed: [192.168.127.147] => (item=php-curl)
changed: [192.168.127.147] => (item=php-gd)
changed: [192.168.127.147] => (item=php-mbstring)
changed: [192.168.127.147] => (item=php-xml)
changed: [192.168.127.147] => (item=php-xmlrpc)
changed: [192.168.127.147] => (item=php-soap)
changed: [192.168.127.147] => (item=php-intl)
changed: [192.168.127.147] => (item=php-zip)
TASK [Create document root] *********************************************************changed: [192.168.127.147]
changed: [192.168.127.147]
TASK [Set up Apache VirtualHost] ****************************************************changed: [192.168.127.147]
TASK [Enable rewrite module] ********************************************************changed: [192.168.127.147]
TASK [Enable new site] **************************************************************changed: [192.168.127.147]
TASK [Disable default Apache site] **************************************************changed: [192.168.127.147]
TASK [Set the root password] ********************************************************[WARNING]: Module did not set no_log for update_password
changed: [192.168.127.147]
TASK [Remove all anonymous user accounts] *******************************************ok: [192.168.127.147]
TASK [Remove the MySQL test database] ***********************************************ok: [192.168.127.147]
TASK [Creates database for WordPress] ***********************************************changed: [192.168.127.147]
TASK [Create MySQL user for WordPress] **********************************************[WARNING]: Module did not set no_log for update_********
changed: [192.168.127.147]
TASK [UFW - Allow HTTP on port 80] **************************************************changed: [192.168.127.147]
TASK [Download and unpack latest WordPress] *****************************************changed: [192.168.127.147]
TASK [Set ownership] ****************************************************************changed: [192.168.127.147]
TASK [Set permissions for directories] **********************************************changed: [192.168.127.147]
TASK [Set permissions for files] ****************************************************changed: [192.168.127.147]
TASK [Set up wp-config] *************************************************************changed: [192.168.127.147]
RUNNING HANDLER [Reload Apache] *****************************************************changed: [192.168.127.147]
RUNNING HANDLER [Restart Apache] ****************************************************changed: [192.168.127.147]
PLAY RECAP **************************************************************************192.168.127.147            : ok=22   changed=19   unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
  • Tarayıcınıza ansibleye bağlı makinenin IP adresini giriniz wordpress ekranı ile karşılaşacaksınız
http://IP_ADRESS
  • YAPILANDIRMA BAŞARILI