Closed RVIRUS0817 closed 5 years ago
@naoya0408 よろしくお願いします!!🤣
プルリクをしましたのでご確認ください。 安達さんのコードを参考にして作ってみました。 挙動は以下になります。
$ ansible-playbook wordpress.yml
PLAY [all] *********************************************************************************
TASK [Gathering Facts] *********************************************************************
ok: [192.168.33.10]
TASK [common : include tasks/base-packages.yml] ********************************************
included: /etc/ansible/roles/common/tasks/base-packages.yml for 192.168.33.10
TASK [common : yum install bacepackage] ****************************************************
ok: [192.168.33.10] => (item=vim)
ok: [192.168.33.10] => (item=zsh)
ok: [192.168.33.10] => (item=git)
ok: [192.168.33.10] => (item=tree)
ok: [192.168.33.10] => (item=htop)
ok: [192.168.33.10] => (item=iftop)
ok: [192.168.33.10] => (item=mlocate)
ok: [192.168.33.10] => (item=telnet)
ok: [192.168.33.10] => (item=wget)
ok: [192.168.33.10] => (item=ipa-pgothic-fonts)
TASK [common : include tasks/user.yml] *****************************************************
included: /etc/ansible/roles/common/tasks/user.yml for 192.168.33.10
TASK [common : create group menta] *********************************************************
ok: [192.168.33.10]
TASK [common : create user menta] **********************************************************
ok: [192.168.33.10]
TASK [common : add sudoers] ****************************************************************
ok: [192.168.33.10]
TASK [common : authorized_key for user menta] **********************************************
fatal: [192.168.33.10]: FAILED! => {"changed": false, "msg": "invalid key specified: authorized_keys"}
...ignoring
TASK [h2o : copy h2o.repo] *****************************************************************
ok: [192.168.33.10]
TASK [h2o : install h2o] *******************************************************************
ok: [192.168.33.10]
TASK [h2o : start h2o] *********************************************************************
ok: [192.168.33.10]
TASK [h2o : copy h2o menta.me.conf] ********************************************************
ok: [192.168.33.10] => (item={u'src': u'menta.me.conf'})
TASK [h2o : copy h2o.conf] *****************************************************************
ok: [192.168.33.10] => (item={u'src': u'h2o.conf'})
TASK [mysql : add repository] **************************************************************
ok: [192.168.33.10] => (item=https://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm)
TASK [mysql : install mysql] ***************************************************************
ok: [192.168.33.10] => (item=mysql-community-server)
TASK [mysql : start mysqld] ****************************************************************
ok: [192.168.33.10]
TASK [mysql : copy mysqld config] **********************************************************
ok: [192.168.33.10] => (item={u'dest': u'.', u'src': u'my.cnf'})
TASK [php : install remi & epel] ***********************************************************
ok: [192.168.33.10] => (item=epel-release)
ok: [192.168.33.10] => (item=https://rpms.remirepo.net/enterprise/remi-release-7.rpm)
TASK [php : php install] *******************************************************************
ok: [192.168.33.10] => (item=php)
ok: [192.168.33.10] => (item=php-devel)
ok: [192.168.33.10] => (item=php-mysql)
ok: [192.168.33.10] => (item=php-gd)
ok: [192.168.33.10] => (item=php-mbstring)
ok: [192.168.33.10] => (item=php-fpm)
TASK [php : copy php-fpm www.conf] *********************************************************
ok: [192.168.33.10] => (item={u'dest': u'.', u'src': u'www.conf'})
TASK [httpd : install apache] **************************************************************
ok: [192.168.33.10]
TASK [httpd : copy httpd.conf] *************************************************************
ok: [192.168.33.10] => (item={u'src': u'httpd.conf'})
TASK [nginx : copy nginx.repo] *************************************************************
ok: [192.168.33.10]
TASK [nginx : install nginx] ***************************************************************
ok: [192.168.33.10]
TASK [nginx : copy nginx menta.me.conf] ****************************************************
ok: [192.168.33.10] => (item={u'src': u'menta.me.conf'})
TASK [nginx : copy nginx.conf] *************************************************************
ok: [192.168.33.10] => (item={u'src': u'nginx.conf'})
PLAY RECAP *********************************************************************************
192.168.33.10 : ok=26 changed=0 unreachable=0 failed=0
https://github.com/naoya0408/menta/issues/10
上記wordpressの構築が完了したので、次は手動でインストールしたパッケージや設定をansibleで自動化する。
まずはansibleの基礎を理解するところから初めて、以下に私のコードを参考にして進めてみてください。 https://github.com/RVIRUS0817/ansible_wordpress