1. 整体测试

1.1 运行playbook

playbook的整体运行过程如下(因为之前都运行过因此很多都显示ok,未运行):

[root@xuzhichao cluster-roles]# ansible-playbook wordpress_site.yml 

PLAY [all] *************************************************************************************************************************************************
****************************************************************** TASK [Gathering Facts] *************************************************************************************************************************************
ok: [192.168.20.31]
ok: [192.168.20.30]
ok: [192.168.20.32]
ok: [192.168.20.61]
ok: [192.168.20.70] TASK [base-module : Configuer Base Repo] *******************************************************************************************************************
ok: [192.168.20.31]
ok: [192.168.20.32]
ok: [192.168.20.61]
ok: [192.168.20.23]
ok: [192.168.20.22]
ok: [192.168.20.19]
ok: [192.168.20.30]
ok: [192.168.20.70]
ok: [192.168.20.20]
ok: [192.168.20.50] TASK [base-module : Configuer Eepl Repo] *******************************************************************************************************************
ok: [192.168.20.31]
ok: [192.168.20.32]
ok: [192.168.20.23]
ok: [192.168.20.61]
ok: [192.168.20.22]
ok: [192.168.20.19]
ok: [192.168.20.20]
ok: [192.168.20.70]
ok: [192.168.20.30]
ok: [192.168.20.50] TASK [base-module : Configuer PHP Repo] ********************************************************************************************************************
skipping: [192.168.20.31]
skipping: [192.168.20.32]
skipping: [192.168.20.61]
skipping: [192.168.20.19]
skipping: [192.168.20.20]
skipping: [192.168.20.30]
skipping: [192.168.20.70]
skipping: [192.168.20.50]
changed: [192.168.20.22]
changed: [192.168.20.23] TASK [base-module : Install Base SoftWare] *****************************************************************************************************************
ok: [192.168.20.61] => (item=wget)
ok: [192.168.20.23] => (item=wget)
ok: [192.168.20.22] => (item=wget)
ok: [192.168.20.31] => (item=wget)
ok: [192.168.20.32] => (item=wget)
ok: [192.168.20.61] => (item=httpd-tools)
ok: [192.168.20.31] => (item=httpd-tools)
ok: [192.168.20.23] => (item=httpd-tools)
ok: [192.168.20.32] => (item=httpd-tools)
ok: [192.168.20.22] => (item=httpd-tools)
ok: [192.168.20.61] => (item=lrzsz)
ok: [192.168.20.31] => (item=lrzsz)
ok: [192.168.20.22] => (item=lrzsz)
ok: [192.168.20.32] => (item=lrzsz)
ok: [192.168.20.23] => (item=lrzsz)
ok: [192.168.20.61] => (item=nfs-utils)
ok: [192.168.20.31] => (item=nfs-utils)
ok: [192.168.20.61] => (item=bind-utils)
ok: [192.168.20.32] => (item=nfs-utils)
ok: [192.168.20.23] => (item=nfs-utils)
ok: [192.168.20.22] => (item=nfs-utils)
ok: [192.168.20.31] => (item=bind-utils)
ok: [192.168.20.61] => (item=net-tools)
ok: [192.168.20.22] => (item=bind-utils)
ok: [192.168.20.23] => (item=bind-utils)
ok: [192.168.20.32] => (item=bind-utils)
ok: [192.168.20.31] => (item=net-tools)
ok: [192.168.20.61] => (item=unzip)
ok: [192.168.20.22] => (item=net-tools)
ok: [192.168.20.32] => (item=net-tools)
ok: [192.168.20.23] => (item=net-tools)
ok: [192.168.20.31] => (item=unzip)
ok: [192.168.20.22] => (item=unzip)
ok: [192.168.20.32] => (item=unzip)
ok: [192.168.20.23] => (item=unzip)
ok: [192.168.20.61] => (item=vim)
ok: [192.168.20.61] => (item=gcc)
ok: [192.168.20.61] => (item=mariadb)
ok: [192.168.20.61] => (item=MySQL-python)
ok: [192.168.20.23] => (item=vim)
ok: [192.168.20.61] => (item=git)
ok: [192.168.20.22] => (item=vim)
ok: [192.168.20.23] => (item=gcc)
ok: [192.168.20.61] => (item=autofs)
ok: [192.168.20.22] => (item=gcc)
ok: [192.168.20.23] => (item=mariadb)
ok: [192.168.20.61] => (item=bash-completion.noarch)
ok: [192.168.20.23] => (item=MySQL-python)
ok: [192.168.20.22] => (item=mariadb)
ok: [192.168.20.61] => (item=expect)
ok: [192.168.20.22] => (item=MySQL-python)
ok: [192.168.20.23] => (item=git)
ok: [192.168.20.19] => (item=wget)
ok: [192.168.20.22] => (item=git)
ok: [192.168.20.23] => (item=autofs)
ok: [192.168.20.19] => (item=httpd-tools)
ok: [192.168.20.22] => (item=autofs)
ok: [192.168.20.23] => (item=bash-completion.noarch)
ok: [192.168.20.19] => (item=lrzsz)
ok: [192.168.20.23] => (item=expect)
ok: [192.168.20.22] => (item=bash-completion.noarch)
ok: [192.168.20.32] => (item=vim)
ok: [192.168.20.19] => (item=nfs-utils)
ok: [192.168.20.22] => (item=expect)
ok: [192.168.20.19] => (item=bind-utils)
ok: [192.168.20.20] => (item=wget)
ok: [192.168.20.32] => (item=gcc)
ok: [192.168.20.19] => (item=net-tools)
ok: [192.168.20.32] => (item=mariadb)
ok: [192.168.20.20] => (item=httpd-tools)
ok: [192.168.20.30] => (item=wget)
ok: [192.168.20.19] => (item=unzip)
ok: [192.168.20.32] => (item=MySQL-python)
ok: [192.168.20.20] => (item=lrzsz)
ok: [192.168.20.30] => (item=httpd-tools)
ok: [192.168.20.30] => (item=lrzsz)
ok: [192.168.20.20] => (item=nfs-utils)
ok: [192.168.20.32] => (item=git)
ok: [192.168.20.19] => (item=vim)
ok: [192.168.20.30] => (item=nfs-utils)
ok: [192.168.20.20] => (item=bind-utils)
ok: [192.168.20.32] => (item=autofs)
ok: [192.168.20.19] => (item=gcc)
ok: [192.168.20.30] => (item=bind-utils)
ok: [192.168.20.20] => (item=net-tools)
ok: [192.168.20.19] => (item=mariadb)
ok: [192.168.20.30] => (item=net-tools)
ok: [192.168.20.32] => (item=bash-completion.noarch)
ok: [192.168.20.20] => (item=unzip)
ok: [192.168.20.19] => (item=MySQL-python)
ok: [192.168.20.30] => (item=unzip)
ok: [192.168.20.32] => (item=expect)
ok: [192.168.20.31] => (item=vim)
ok: [192.168.20.19] => (item=git)
ok: [192.168.20.20] => (item=vim)
ok: [192.168.20.70] => (item=wget)
ok: [192.168.20.31] => (item=gcc)
ok: [192.168.20.19] => (item=autofs)
ok: [192.168.20.20] => (item=gcc)
ok: [192.168.20.70] => (item=httpd-tools)
ok: [192.168.20.31] => (item=mariadb)
ok: [192.168.20.20] => (item=mariadb)
ok: [192.168.20.19] => (item=bash-completion.noarch)
ok: [192.168.20.70] => (item=lrzsz)
ok: [192.168.20.31] => (item=MySQL-python)
ok: [192.168.20.19] => (item=expect)
ok: [192.168.20.20] => (item=MySQL-python)
ok: [192.168.20.70] => (item=nfs-utils)
ok: [192.168.20.31] => (item=git)
ok: [192.168.20.20] => (item=git)
ok: [192.168.20.70] => (item=bind-utils)
ok: [192.168.20.50] => (item=wget)
ok: [192.168.20.31] => (item=autofs)
ok: [192.168.20.20] => (item=autofs)
ok: [192.168.20.70] => (item=net-tools)
ok: [192.168.20.50] => (item=httpd-tools)
ok: [192.168.20.20] => (item=bash-completion.noarch)
ok: [192.168.20.70] => (item=unzip)
ok: [192.168.20.31] => (item=bash-completion.noarch)
ok: [192.168.20.50] => (item=lrzsz)
ok: [192.168.20.20] => (item=expect)
ok: [192.168.20.31] => (item=expect)
ok: [192.168.20.50] => (item=nfs-utils)
ok: [192.168.20.50] => (item=bind-utils)
ok: [192.168.20.50] => (item=net-tools)
ok: [192.168.20.50] => (item=unzip)
ok: [192.168.20.30] => (item=vim)
ok: [192.168.20.30] => (item=gcc)
ok: [192.168.20.30] => (item=mariadb)
ok: [192.168.20.30] => (item=MySQL-python)
ok: [192.168.20.30] => (item=git)
ok: [192.168.20.30] => (item=autofs)
ok: [192.168.20.30] => (item=bash-completion.noarch)
ok: [192.168.20.30] => (item=expect)
ok: [192.168.20.70] => (item=vim)
ok: [192.168.20.70] => (item=gcc)
ok: [192.168.20.70] => (item=mariadb)
ok: [192.168.20.70] => (item=MySQL-python)
ok: [192.168.20.70] => (item=git)
ok: [192.168.20.50] => (item=vim)
ok: [192.168.20.70] => (item=autofs)
ok: [192.168.20.50] => (item=gcc)
ok: [192.168.20.70] => (item=bash-completion.noarch)
ok: [192.168.20.50] => (item=mariadb)
ok: [192.168.20.70] => (item=expect)
ok: [192.168.20.50] => (item=MySQL-python)
ok: [192.168.20.50] => (item=git)
ok: [192.168.20.50] => (item=autofs)
ok: [192.168.20.50] => (item=bash-completion.noarch)
ok: [192.168.20.50] => (item=expect) TASK [base-module : Create Process Group] ******************************************************************************************************************
ok: [192.168.20.31]
ok: [192.168.20.23]
ok: [192.168.20.22]
ok: [192.168.20.32]
ok: [192.168.20.61]
ok: [192.168.20.19]
ok: [192.168.20.70]
ok: [192.168.20.30]
ok: [192.168.20.50]
ok: [192.168.20.20] TASK [base-module : Create Process Group] ******************************************************************************************************************
ok: [192.168.20.31]
ok: [192.168.20.61]
ok: [192.168.20.32]
ok: [192.168.20.23]
ok: [192.168.20.22]
ok: [192.168.20.19]
ok: [192.168.20.30]
ok: [192.168.20.70]
ok: [192.168.20.20]
ok: [192.168.20.50] TASK [base-module : Disable Firewalld] *********************************************************************************************************************
ok: [192.168.20.23]
ok: [192.168.20.22]
ok: [192.168.20.61]
changed: [192.168.20.31]
changed: [192.168.20.32]
ok: [192.168.20.30]
changed: [192.168.20.19]
changed: [192.168.20.70]
changed: [192.168.20.20]
changed: [192.168.20.50] TASK [base-module : Disable Selinux] ***********************************************************************************************************************
ok: [192.168.20.31]
ok: [192.168.20.22]
ok: [192.168.20.61]
ok: [192.168.20.32]
ok: [192.168.20.23]
ok: [192.168.20.19]
ok: [192.168.20.30]
ok: [192.168.20.20]
ok: [192.168.20.70]
ok: [192.168.20.50] TASK [wordpress-base : Modify Gateway And Dns] *************************************************************************************************************
changed: [192.168.20.23]
changed: [192.168.20.61]
changed: [192.168.20.31]
changed: [192.168.20.22]
changed: [192.168.20.32]
changed: [192.168.20.19]
changed: [192.168.20.20]
changed: [192.168.20.30]
changed: [192.168.20.70]
changed: [192.168.20.50] TASK [wordpress-base : Restart Network] ********************************************************************************************************************
changed: [192.168.20.31]
changed: [192.168.20.22]
changed: [192.168.20.32]
changed: [192.168.20.23]
changed: [192.168.20.61]
changed: [192.168.20.20]
changed: [192.168.20.19]
changed: [192.168.20.30]
changed: [192.168.20.50]
changed: [192.168.20.70] PLAY [webservers] ****************************************************************************************************************************************** TASK [nginx : Create Nginx Install Path] *******************************************************************************************************************
ok: [192.168.20.23]
ok: [192.168.20.22] TASK [nginx : Unarchive Nginx Packages] ********************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [nginx : Install Dependencies For Building Nginx] *****************************************************************************************************
ok: [192.168.20.22] => (item=pcre-devel)
ok: [192.168.20.23] => (item=pcre-devel)
ok: [192.168.20.23] => (item=openssl-devel)
ok: [192.168.20.22] => (item=openssl-devel)
ok: [192.168.20.22] => (item=zlib-devel)
ok: [192.168.20.23] => (item=zlib-devel)
ok: [192.168.20.22] => (item=pcre)
ok: [192.168.20.23] => (item=pcre)
ok: [192.168.20.22] => (item=openssl)
ok: [192.168.20.23] => (item=openssl)
ok: [192.168.20.23] => (item=zlib)
ok: [192.168.20.22] => (item=zlib)
ok: [192.168.20.22] => (item=@Development tools)
ok: [192.168.20.23] => (item=@Development tools) TASK [nginx : Configure Nginx] *****************************************************************************************************************************
skipping: [192.168.20.22]
skipping: [192.168.20.23] TASK [nginx : Build Nginx] *********************************************************************************************************************************
skipping: [192.168.20.22]
skipping: [192.168.20.23] TASK [nginx : Copy Nginx Unit File] ************************************************************************************************************************
ok: [192.168.20.23]
ok: [192.168.20.22] TASK [nginx : Reload Systemd] ******************************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [nginx : Copy Nginx Main Configure File] **************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [nginx : Check Nginx Configure File] ******************************************************************************************************************
ok: [192.168.20.23]
ok: [192.168.20.22] TASK [nginx : Create Confihure Directory] ******************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [nginx : Start Nginx] *********************************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [php-fpm : Create PHP Install Path] *******************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [php-fpm : Unarchive PHP Packages] ********************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [php-fpm : Install Dependencies For Building PHP] *****************************************************************************************************
ok: [192.168.20.22] => (item=libxml2)
ok: [192.168.20.23] => (item=libxml2)
ok: [192.168.20.22] => (item=libxml2-devel)
ok: [192.168.20.23] => (item=libxml2-devel)
ok: [192.168.20.22] => (item=openssl)
ok: [192.168.20.23] => (item=openssl)
ok: [192.168.20.22] => (item=openssl-devel)
ok: [192.168.20.23] => (item=openssl-devel)
ok: [192.168.20.22] => (item=curl)
ok: [192.168.20.23] => (item=curl)
ok: [192.168.20.22] => (item=curl-devel)
ok: [192.168.20.23] => (item=curl-devel)
ok: [192.168.20.23] => (item=libpng)
ok: [192.168.20.22] => (item=libpng)
ok: [192.168.20.23] => (item=libpng-devel)
ok: [192.168.20.22] => (item=libpng-devel)
ok: [192.168.20.23] => (item=freetype)
ok: [192.168.20.22] => (item=freetype)
ok: [192.168.20.23] => (item=freetype-devel)
ok: [192.168.20.22] => (item=freetype-devel)
ok: [192.168.20.23] => (item=libmcrypt-devel)
ok: [192.168.20.22] => (item=libmcrypt-devel)
ok: [192.168.20.23] => (item=libzip-devel)
ok: [192.168.20.22] => (item=libzip-devel)
ok: [192.168.20.23] => (item=pcre)
ok: [192.168.20.22] => (item=pcre)
ok: [192.168.20.23] => (item=pcre-devel)
ok: [192.168.20.22] => (item=pcre-devel)
ok: [192.168.20.23] => (item=bzip2-devel)
ok: [192.168.20.22] => (item=bzip2-devel)
ok: [192.168.20.23] => (item=libicu-devel)
ok: [192.168.20.22] => (item=libicu-devel)
ok: [192.168.20.23] => (item=gcc)
ok: [192.168.20.22] => (item=gcc)
ok: [192.168.20.23] => (item=gcc-c++)
ok: [192.168.20.22] => (item=gcc-c++)
ok: [192.168.20.23] => (item=autoconf)
ok: [192.168.20.22] => (item=autoconf)
ok: [192.168.20.22] => (item=libjpeg)
ok: [192.168.20.23] => (item=libjpeg)
ok: [192.168.20.22] => (item=libjpeg-devel)
ok: [192.168.20.23] => (item=libjpeg-devel)
ok: [192.168.20.22] => (item=zlib)
ok: [192.168.20.23] => (item=zlib)
ok: [192.168.20.22] => (item=zlib-devel)
ok: [192.168.20.23] => (item=zlib-devel)
ok: [192.168.20.22] => (item=glibc)
ok: [192.168.20.23] => (item=glibc)
ok: [192.168.20.22] => (item=glibc-devel)
ok: [192.168.20.23] => (item=glibc-devel)
ok: [192.168.20.22] => (item=glib2)
ok: [192.168.20.23] => (item=glib2)
ok: [192.168.20.22] => (item=glib2-devel)
ok: [192.168.20.23] => (item=glib2-devel)
ok: [192.168.20.22] => (item=ncurses)
ok: [192.168.20.23] => (item=ncurses)
ok: [192.168.20.22] => (item=ncurses-devel)
ok: [192.168.20.23] => (item=ncurses-devel)
ok: [192.168.20.22] => (item=krb5-devel)
ok: [192.168.20.23] => (item=krb5-devel)
ok: [192.168.20.22] => (item=libidn)
ok: [192.168.20.23] => (item=libidn)
ok: [192.168.20.22] => (item=libidn-devel)
ok: [192.168.20.23] => (item=libidn-devel)
ok: [192.168.20.22] => (item=openldap)
ok: [192.168.20.23] => (item=openldap)
ok: [192.168.20.22] => (item=openldap-devel)
ok: [192.168.20.23] => (item=openldap-devel)
ok: [192.168.20.22] => (item=nss_ldap)
ok: [192.168.20.23] => (item=nss_ldap)
ok: [192.168.20.22] => (item=jemalloc-devel)
ok: [192.168.20.23] => (item=jemalloc-devel)
ok: [192.168.20.22] => (item=cmake)
ok: [192.168.20.23] => (item=cmake)
ok: [192.168.20.22] => (item=boost-devel)
ok: [192.168.20.23] => (item=boost-devel)
ok: [192.168.20.22] => (item=bison)
ok: [192.168.20.23] => (item=bison)
ok: [192.168.20.22] => (item=automake)
ok: [192.168.20.23] => (item=automake)
ok: [192.168.20.22] => (item=libevent)
ok: [192.168.20.23] => (item=libevent)
ok: [192.168.20.22] => (item=libevent-devel)
ok: [192.168.20.23] => (item=libevent-devel)
ok: [192.168.20.22] => (item=gd)
ok: [192.168.20.23] => (item=gd)
ok: [192.168.20.22] => (item=gd-devel)
ok: [192.168.20.23] => (item=gd-devel)
ok: [192.168.20.23] => (item=libtool*)
ok: [192.168.20.22] => (item=libtool*)
ok: [192.168.20.23] => (item=mcrypt)
ok: [192.168.20.22] => (item=mcrypt)
ok: [192.168.20.23] => (item=mhash)
ok: [192.168.20.22] => (item=mhash)
ok: [192.168.20.23] => (item=libxslt)
ok: [192.168.20.22] => (item=libxslt)
ok: [192.168.20.23] => (item=libxslt-devel)
ok: [192.168.20.22] => (item=libxslt-devel)
ok: [192.168.20.23] => (item=readline)
ok: [192.168.20.22] => (item=readline)
ok: [192.168.20.23] => (item=readline-devel)
ok: [192.168.20.22] => (item=readline-devel)
ok: [192.168.20.22] => (item=gmp)
ok: [192.168.20.23] => (item=gmp)
ok: [192.168.20.22] => (item=gmp-devel)
ok: [192.168.20.23] => (item=gmp-devel)
ok: [192.168.20.22] => (item=libcurl)
ok: [192.168.20.23] => (item=libcurl)
ok: [192.168.20.22] => (item=libcurl-devel)
ok: [192.168.20.23] => (item=libcurl-devel)
ok: [192.168.20.22] => (item=openjpeg-devel)
ok: [192.168.20.23] => (item=openjpeg-devel) TASK [php-fpm : Configure PHP] *****************************************************************************************************************************
skipping: [192.168.20.22]
skipping: [192.168.20.23] TASK [php-fpm : Build PHP] *********************************************************************************************************************************
skipping: [192.168.20.22]
skipping: [192.168.20.23] TASK [php-fpm : Copy PHP-FPM Unit File] ********************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [php-fpm : Reload Systemd] ****************************************************************************************************************************
ok: [192.168.20.23]
ok: [192.168.20.22] TASK [php-fpm : Create Log Path] ***************************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [php-fpm : Copy PHP and PHP-FPM Configure File] *******************************************************************************************************
ok: [192.168.20.22] => (item={u'dest': u'/soft/php/etc/php.ini', u'src': u'php.ini.j2'})
ok: [192.168.20.23] => (item={u'dest': u'/soft/php/etc/php.ini', u'src': u'php.ini.j2'})
ok: [192.168.20.22] => (item={u'dest': u'/soft/php/etc/php-fpm.d/www.conf', u'src': u'www.conf.j2'})
ok: [192.168.20.23] => (item={u'dest': u'/soft/php/etc/php-fpm.d/www.conf', u'src': u'www.conf.j2'})
ok: [192.168.20.22] => (item={u'dest': u'/soft/php/etc/php-fpm.conf', u'src': u'php-fpm.conf.j2'})
ok: [192.168.20.23] => (item={u'dest': u'/soft/php/etc/php-fpm.conf', u'src': u'php-fpm.conf.j2'}) TASK [php-fpm : Check PHP Configure File] ******************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [php-fpm : Start PHP-FPM] *****************************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [wordpress-web : Unarchive Wordpress Code] ************************************************************************************************************
ok: [192.168.20.23]
ok: [192.168.20.22] TASK [wordpress-web : Create wp-content/uploads directory] *************************************************************************************************
ok: [192.168.20.23]
ok: [192.168.20.22] TASK [wordpress-web : Mount NFS Point] *********************************************************************************************************************
ok: [192.168.20.23]
ok: [192.168.20.22] TASK [wordpress-web : Copy Nginx Vhosts Configure File] ****************************************************************************************************
ok: [192.168.20.23]
ok: [192.168.20.22] TASK [wordpress-web : Check Nginx Configure File] **********************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [wordpress-web : Install php-pecl-redis] **************************************************************************************************************
ok: [192.168.20.23]
ok: [192.168.20.22] TASK [wordpress-web : Unarchive php-Redis] *****************************************************************************************************************
ok: [192.168.20.23]
ok: [192.168.20.22] TASK [wordpress-web : phpize] ******************************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [wordpress-web : Configure] ***************************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] TASK [wordpress-web : Make And Make Install] ***************************************************************************************************************
ok: [192.168.20.22]
ok: [192.168.20.23] PLAY [lbservers] ******************************************************************************************************************************************* TASK [nginx : Create Nginx Install Path] *******************************************************************************************************************
ok: [192.168.20.19]
ok: [192.168.20.20] TASK [nginx : Unarchive Nginx Packages] ********************************************************************************************************************
ok: [192.168.20.19]
ok: [192.168.20.20] TASK [nginx : Install Dependencies For Building Nginx] *****************************************************************************************************
ok: [192.168.20.19] => (item=pcre-devel)
ok: [192.168.20.20] => (item=pcre-devel)
ok: [192.168.20.19] => (item=openssl-devel)
ok: [192.168.20.20] => (item=openssl-devel)
ok: [192.168.20.19] => (item=zlib-devel)
ok: [192.168.20.20] => (item=zlib-devel)
ok: [192.168.20.19] => (item=pcre)
ok: [192.168.20.20] => (item=pcre)
ok: [192.168.20.19] => (item=openssl)
ok: [192.168.20.20] => (item=openssl)
ok: [192.168.20.19] => (item=zlib)
ok: [192.168.20.20] => (item=zlib)
ok: [192.168.20.19] => (item=@Development tools)
ok: [192.168.20.20] => (item=@Development tools) TASK [nginx : Configure Nginx] *****************************************************************************************************************************
skipping: [192.168.20.19]
skipping: [192.168.20.20] TASK [nginx : Build Nginx] *********************************************************************************************************************************
skipping: [192.168.20.19]
skipping: [192.168.20.20] TASK [nginx : Copy Nginx Unit File] ************************************************************************************************************************
ok: [192.168.20.19]
ok: [192.168.20.20] TASK [nginx : Reload Systemd] ******************************************************************************************************************************
ok: [192.168.20.19]
ok: [192.168.20.20] TASK [nginx : Copy Nginx Main Configure File] **************************************************************************************************************
ok: [192.168.20.19]
ok: [192.168.20.20] TASK [nginx : Check Nginx Configure File] ******************************************************************************************************************
ok: [192.168.20.19]
ok: [192.168.20.20] TASK [nginx : Create Confihure Directory] ******************************************************************************************************************
ok: [192.168.20.19]
ok: [192.168.20.20] TASK [nginx : Start Nginx] *********************************************************************************************************************************
ok: [192.168.20.19]
ok: [192.168.20.20] TASK [wordpress-proxy : Create Cert directory] *************************************************************************************************************
ok: [192.168.20.20]
ok: [192.168.20.19] TASK [wordpress-proxy : Copy SSL Cer File] *****************************************************************************************************************
ok: [192.168.20.19] => (item={u'dest': u'/soft/nginx/certs/xuzhichao.key', u'src': u'xuzhichao.key'})
ok: [192.168.20.20] => (item={u'dest': u'/soft/nginx/certs/xuzhichao.key', u'src': u'xuzhichao.key'})
ok: [192.168.20.19] => (item={u'dest': u'/soft/nginx/certs/xuzhichao.crt', u'src': u'xuzhichao.crt'})
ok: [192.168.20.20] => (item={u'dest': u'/soft/nginx/certs/xuzhichao.crt', u'src': u'xuzhichao.crt'}) TASK [wordpress-proxy : Copy Nginx-LB Vhosts Configure] ****************************************************************************************************
ok: [192.168.20.19] => (item={u'dest': u'/soft/nginx/conf/conf.d/wordpress.conf', u'src': u'wordpress.conf.j2'})
ok: [192.168.20.20] => (item={u'dest': u'/soft/nginx/conf/conf.d/wordpress.conf', u'src': u'wordpress.conf.j2'})
ok: [192.168.20.19] => (item={u'dest': u'/soft/nginx/conf/proxy_params', u'src': u'proxy_params.j2'})
ok: [192.168.20.20] => (item={u'dest': u'/soft/nginx/conf/proxy_params', u'src': u'proxy_params.j2'}) TASK [wordpress-proxy : Check Nginx Configure File] ********************************************************************************************************
ok: [192.168.20.19]
ok: [192.168.20.20] TASK [wordpress-proxy : LVS DR RS Scripts] *****************************************************************************************************************
changed: [192.168.20.19]
changed: [192.168.20.20] PLAY [mysql] *********************************************************************************************************************************************** TASK [mariadb : Create Mysql Group] ************************************************************************************************************************
ok: [192.168.20.50] TASK [mariadb : Create Mysql User] *************************************************************************************************************************
ok: [192.168.20.50] TASK [mariadb : Create Mysql Work Directory] ***************************************************************************************************************
ok: [192.168.20.50] => (item=/var/lib/mysql/)
ok: [192.168.20.50] => (item=/data/mysql) TASK [mariadb : Unarchive Mariadb Package] *****************************************************************************************************************
changed: [192.168.20.50] TASK [mariadb : Create Mariadb Link File] ******************************************************************************************************************
ok: [192.168.20.50] TASK [mariadb : Init Mysql Database] ***********************************************************************************************************************
ok: [192.168.20.50] TASK [mariadb : Copy Mariadb Service File] *****************************************************************************************************************
ok: [192.168.20.50] TASK [mariadb : Copy Mariadb Configure File] ***************************************************************************************************************
ok: [192.168.20.50] TASK [mariadb : Start Mariadb Server] **********************************************************************************************************************
ok: [192.168.20.50] TASK [mariadb : Create Mysql.sock Link File] ***************************************************************************************************************
ok: [192.168.20.50] TASK [mariadb : Grant Database User] ***********************************************************************************************************************
[WARNING]: The value ******** (type int) in a string field was converted to u'********' (type string). If this does not look like what you expect, quote
the entire value to ensure it does not change.
[WARNING]: Module did not set no_log for update_password
ok: [192.168.20.50] TASK [wordpress-mysql : Create Wordpress Database] *********************************************************************************************************
ok: [192.168.20.50] TASK [wordpress-mysql : Grant Wordpress Database User] *****************************************************************************************************
ok: [192.168.20.50] PLAY [redis] *********************************************************************************************************************************************** TASK [redis : Install Redis] *******************************************************************************************************************************
ok: [192.168.20.61] TASK [redis : Copy Configure File] *************************************************************************************************************************
ok: [192.168.20.61] TASK [redis : Start Redis] *********************************************************************************************************************************
ok: [192.168.20.61] PLAY [nfs] ************************************************************************************************************************************************* TASK [nfs : Install NFS Server] ****************************************************************************************************************************
ok: [192.168.20.30] TASK [nfs : Configure NFS Server] **************************************************************************************************************************
ok: [192.168.20.30] TASK [nfs : Init NFS Server] *******************************************************************************************************************************
changed: [192.168.20.30] TASK [nfs : Start NFS service] *****************************************************************************************************************************
ok: [192.168.20.30] PLAY [lvs] ************************************************************************************************************************************************* TASK [keepalived : Install Keepalived] *********************************************************************************************************************
ok: [192.168.20.31]
ok: [192.168.20.32] TASK [keepalived : Copy Notify Script] *********************************************************************************************************************
ok: [192.168.20.32]
ok: [192.168.20.31] TASK [keepalived : Copy Configure File] ********************************************************************************************************************
ok: [192.168.20.32]
ok: [192.168.20.31] TASK [keepalived : Start Keepalived] ***********************************************************************************************************************
ok: [192.168.20.32]
ok: [192.168.20.31] PLAY [dns] ************************************************************************************************************************************************* TASK [dns : Install Dns Server] ****************************************************************************************************************************
ok: [192.168.20.70] TASK [dns : Copy Configure File And Zone File] *************************************************************************************************************
ok: [192.168.20.70] => (item={u'dest': u'/etc/named.conf', u'src': u'named.conf.j2'})
ok: [192.168.20.70] => (item={u'dest': u'/var/named/xuzhichao.com.zone', u'src': u'xuzhichao.com.zone.j2'})
ok: [192.168.20.70] => (item={u'dest': u'/etc/named.xuzhichao.com.zone', u'src': u'named.xuzhichao.com.zone.j2'})
ok: [192.168.20.70] => (item={u'dest': u'/var/named/20.168.192.in-addr.arpa.zone', u'src': u'20.168.192.in-addr.arpa.zone.j2'}) TASK [dns : Start Dns Server] ******************************************************************************************************************************
ok: [192.168.20.70] PLAY RECAP *************************************************************************************************************************************************
192.168.20.19 : ok=23 changed=4 unreachable=0 failed=0 skipped=3 rescued=0 ignored=0
192.168.20.20 : ok=23 changed=4 unreachable=0 failed=0 skipped=3 rescued=0 ignored=0
192.168.20.22 : ok=38 changed=3 unreachable=0 failed=0 skipped=4 rescued=0 ignored=0
192.168.20.23 : ok=38 changed=3 unreachable=0 failed=0 skipped=4 rescued=0 ignored=0
192.168.20.30 : ok=14 changed=3 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
192.168.20.31 : ok=14 changed=3 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
192.168.20.32 : ok=14 changed=3 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
192.168.20.50 : ok=22 changed=4 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
192.168.20.61 : ok=13 changed=2 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
192.168.20.70 : ok=13 changed=3 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0

1.2 出口路由器防火墙规则设置

  • 设置出接口IP地址:

    [root@xuzhichao ~]# ip add add 192.168.50.200/24 dev eth2
    [root@xuzhichao ~]# ip add add 192.168.50.201/24 dev eth2 [root@xuzhichao ~]# ip add show eth2
    4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:2f:d0:e4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.50.17/24 brd 192.168.50.255 scope global noprefixroute eth2
    valid_lft forever preferred_lft forever
    inet 192.168.50.200/24 scope global secondary eth2
    valid_lft forever preferred_lft forever
    inet 192.168.50.201/24 scope global secondary eth2
    valid_lft forever preferred_lft forever
  • 设置防火墙DNAT规则:

    [root@xuzhichao ~]# iptables -t nat -I PREROUTING -d 192.168.50.200 -j DNAT --to 192.168.20.200
    [root@xuzhichao ~]# iptables -t nat -I PREROUTING -d 192.168.50.201 -j DNAT --to 192.168.20.201
    .
    [root@xuzhichao ~]# iptables -t nat -vnL
    Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
    pkts bytes target prot opt in out source destination
    0 0 DNAT all -- * * 0.0.0.0/0 192.168.50.201 to:192.168.20.201
    0 0 DNAT all -- * * 0.0.0.0/0 192.168.50.200 to:192.168.20.200
  • 开启ip_forward转发:

    [root@xuzhichao cluster-roles]# echo "1" > /proc/sys/net/ipv4/ip_forward

1.3 访问测试

  • 把客户端主机的DNS设置成192.168.50.70
  • 客户端访问http://wordpress.xuzhichao.com

ansible系列(35)--ansible实战之部署WEB集群架构(5)的更多相关文章

  1. Linux Web集群架构详细(亲测可用!!!)

    注意:WEB服务器和数据库需要分离,同时WEB服务器也需要编译安装MySQL. 做集群架构的重要思想就是找到主干,从主干区域向外延展. WEB服务器: apache nginx  本地做三个产品 de ...

  2. CentOS7-自动化部署web集群

    一.项目要求 1.创建role,通过role完成项目(可能需要多个role) 2.部署nginx调度器(node2主机) 3.部署2台lnmp服务器(node3,node4主机) 4.部署mariad ...

  3. Centos 7 部署lnmp集群架构

    前言介绍 lnmp的全程是 linux + nginx + mysql + php; lnmp就是上述系统及应用程序的简写组合: lnmp其实已经代表了一个用户正常对一个页面请求的流程,nginx接收 ...

  4. (二)Kubernetes kubeadm部署k8s集群

    kubeadm介绍 kubeadm是Kubernetes项目自带的及集群构建工具,负责执行构建一个最小化的可用集群以及将其启动等的必要基本步骤,kubeadm是Kubernetes集群全生命周期的管理 ...

  5. Ansible自动化部署K8S集群

    Ansible自动化部署K8S集群 1.1 Ansible介绍 Ansible是一种IT自动化工具.它可以配置系统,部署软件以及协调更高级的IT任务,例如持续部署,滚动更新.Ansible适用于管理企 ...

  6. 003 ansible部署ceph集群

    介绍:在上一次的deploy部署ceph,虽然出了结果,最后的结果并没有满足最初的目的,现在尝试使用ansible部署一遍,看是否会有问题 一.环境准备 ceph1充当部署节点,ceph2,ceph3 ...

  7. ansible playbook部署ELK集群系统

    一.介绍 总共4台机器,分别为 192.168.1.99 192.168.1.100 192.168.1.210 192.168.1.211 服务所在机器为: redis:192.168.1.211 ...

  8. kubernetes系列03—kubeadm安装部署K8S集群

    本文收录在容器技术学习系列文章总目录 1.kubernetes安装介绍 1.1 K8S架构图 1.2 K8S搭建安装示意图 1.3 安装kubernetes方法 1.3.1 方法1:使用kubeadm ...

  9. 实战Centos系统部署Codis集群服务

    导读 Codis 是一个分布式 Redis 解决方案, 对于上层的应用来说, 连接到 Codis Proxy 和连接原生的 Redis Server 没有明显的区别 (不支持的命令列表), 上层应用可 ...

  10. 《跟老男孩学Linux运维:Web集群实战》读书笔记

    Linux 介绍 Linux 安装 Linux 调优 Web 基础 Nginx 应用 LNMP 应用 PHP 缓存加速 Nginx 调优 MySQL 应用 NFS 网络文件共享 Nginx 反向代理与 ...

随机推荐

  1. #差分,前缀和#nssl 1469 U

    分析 考虑离线,因为异或和很难在线处理 然后可以用两个数组来差分斜与横的情况,然后将答案竖着传 时间复杂度\(O(n^2)\) 代码 #include <cstdio> #include ...

  2. #构造,二分#[AGC006B] [AGC006D] Median Pyramid

    Easy Hard 分析(Easy) 若\(X=1\)或\(X=2n-1\)无解,否则在正中间构造\(X-1,X,X+1\), 其余位置升序铺入剩余数, 若\(X-1\)左侧数大于\(X-1\)那么\ ...

  3. 多次复制Excel符合要求的数据行:Python批量实现

      本文介绍基于Python语言,读取Excel表格文件数据,并基于其中某一列数据的值,将这一数据处于指定范围的那一行加以复制,并将所得结果保存为新的Excel表格文件的方法.   首先,我们来明确一 ...

  4. 初学STM32 SDIO (二)

    ​ SD命令由主机发出,以广播命令和寻址命令为例,广播命令是针对与SD主机总线连接的所有从设备发送的,寻址命令是指定某个地址设备进行命令传输. 1.SD命令格式 SD命令格式固定为48bit,都是通过 ...

  5. JS 取Json中对象特定属性值

    解析JSON JSON 数据 var str = '[{"a": "1","b": "2"}, {"a&quo ...

  6. CMakeLists.txt 编写模板

    新建文件   CMakeLists.txt # 设置cmake的最低版本 cmake_minimum_required(VERSION 2.8) # 指定为C++11 版本 set(CMAKE_CXX ...

  7. 堡垒机安装pytorch,mmcv,mmclassification,并训练自己的数据集

    堡垒机创建conda环境,并激活进入环境 conda create -n mmclassification python=3.7 conda activate mmclassification 堡垒机 ...

  8. vue项目node-scss装不上问题( vue执行npm install报错: Can‘t find Python executable “python“, you can set the PYTHON env variable

    一.描述从网上下载的一个Vue模板项目,导入VsCode,执行npm install命令后,报错了,报错的信息是node-sass安装失败,同时提示需要python环境的错误信息,这是因为安装node ...

  9. Node中的EventEmitter? 如何实现一个EventEmitter?

    一.是什么 我们了解到,Node采用了事件驱动机制,而EventEmitter就是Node实现事件驱动的基础 在EventEmitter的基础上,Node几乎所有的模块都继承了这个类,这些模块拥有了自 ...

  10. 力扣183(MySQL)-从不订购的客户(简单)

    题目: 某网站包含两个表,Customers 表和 Orders 表.编写一个 SQL 查询,找出所有从不订购任何东西的客户. Customers 表: Orders 表:  解题思路: 需要查询出没 ...