如何在Ubuntu 18.04上使用Ansible使用LAMP安装和设置WordPress

news/2024/7/7 19:18:44

介绍 (Introduction)

Server automation now plays an essential role in systems administration, due to the disposable nature of modern application environments. Configuration management tools such as Ansible are typically used to streamline the process of automating server setup by establishing standard procedures for new servers while also reducing human error associated with manual setups.

由于现代应用程序环境具有可处理性,因此服务器自动化现在在系统管理中起着至关重要的作用。 配置管理工具(例如Ansible)通常用于通过为新服务器建立标准过程来简化服务器设置自动化的过程,同时还减少了与手动设置相关的人为错误。

Ansible offers a simple architecture that doesn’t require special software to be installed on nodes. It also provides a robust set of features and built-in modules which facilitate writing automation scripts.

Ansible提供了一种简单的体系结构,不需要在节点上安装特殊软件。 它还提供了一组功能强大的功能和内置模块,可帮助编写自动化脚本。

This guide explains how to use Ansible to automate the steps contained in our guide on How To Install WordPress with LAMP on Ubuntu 18.04. WordPress is the most popular CMS (content management system) on the internet, allowing users to set up flexible blogs and websites on top of a MySQL backend with PHP processing. After setup, almost all administration can be done through the web frontend.

本指南介绍了如何使用Ansible自动化我们的指南,该指南包含有关如何在Ubuntu 18.04上使用LAMP安装WordPress的指南。 WordPress是Internet上最流行的CMS(内容管理系统),允许用户在具有PHP处理功能MySQL后端之上建立灵活的博客和网站。 设置后,几乎所有管理都可以通过Web前端完成。

先决条件 (Prerequisites)

In order to execute the automated setup provided by the playbook we’re discussing in this guide, you’ll need:

为了执行我们在本指南中讨论的剧本提供的自动设置,您需要:

  • One Ansible control node: an Ubuntu 18.04 machine with Ansible installed and configured to connect to your Ansible hosts using SSH keys. Make sure the control node has a regular user with sudo permissions and a firewall enabled, as explained in our Initial Server Setup guide. To set up Ansible, please follow our guide on How to Install and Configure Ansible on Ubuntu 18.04.

    一个Ansible控制节点 :安装了Ansible并配置为使用SSH密钥连接到您的Ansible主机的Ubuntu 18.04计算机。 确保控制节点具有sudo权限的常规用户并启用了防火墙,如“ 初始服务器设置”指南中所述。 要设置Ansible,请遵循有关如何在Ubuntu 18.04上安装和配置Ansible的指南。

  • One or more Ansible Hosts: one or more remote Ubuntu 18.04 servers previously set up following the guide on How to Use Ansible to Automate Initial Server Setup on Ubuntu 18.04.

    一台或多台Ansible主机 :一台或多台远程Ubuntu 18.04服务器以前是按照有关如何在Ubuntu 18.04上使用Ansible自动化初始服务器设置的指南进行设置的 。

Before proceeding, you first need to make sure your Ansible control node is able to connect and execute commands on your Ansible host(s). For a connection test, please check step 3 of How to Install and Configure Ansible on Ubuntu 18.04.

在继续之前,您首先需要确保Ansible控制节点能够在Ansible主机上连接并执行命令。 对于连接测试,请检查如何在Ubuntu 18.04上安装和配置Ansible的步骤3。

这本剧本做什么? (What Does this Playbook Do?)

This Ansible playbook provides an alternative to manually running through the procedure outlined in our guide on How To Install WordPress with LAMP on Ubuntu 18.04.

这本Ansible剧本提供了一种替代方法,可以手动执行我们有关如何在Ubuntu 18.04上使用LAMP安装WordPress的指南中概述的过程。

Running this playbook will perform the following actions on your Ansible hosts:

运行此剧本将在您的Ansible主机上执行以下操作:

  1. Install aptitude, which is preferred by Ansible as an alternative to the apt package manager.

    安装aptitude ,这是Ansible首选的替代apt软件包管理器的工具。

  2. Install the required LAMP packages and PHP extensions.

    安装所需的LAMP软件包和PHP扩展。
  3. Create and enable a new Apache VirtualHost for the WordPress website.

    为WordPress网站创建并启用新的Apache VirtualHost

  4. Enable the Apache rewrite (mod_rewrite) module.

    启用Apache重写( mod_rewrite )模块。

  5. Disable the default Apache website.

    禁用默认的Apache网站。
  6. Set the password for the MySQL root user.

    设置MySQL root用户的密码。

  7. Remove anonymous MySQL accounts and the test database.

    删除匿名MySQL帐户和测试数据库。
  8. Create a new MySQL database and user for the WordPress website.

    为WordPress网站创建一个新MySQL数据库和用户。
  9. Set up UFW to allow HTTP traffic on the configured port (80 by default).

    设置UFW,以允许配置的端口上的HTTP通信(默认为80 )。

  10. Download and unpack WordPress.

    下载并解压WordPress。
  11. Set up correct directory ownership and permissions.

    设置正确的目录所有权和权限。
  12. Set up the wp-config.php file using the provided template.

    使用提供的模板设置wp-config.php文件。

Once the playbook has finished running, you will have a WordPress installation running on top of a LAMP environment, based on the options you defined within your configuration variables.

剧本运行完毕后,将根据您在配置变量中定义的选项,在LAMP环境之上运行WordPress安装。

如何使用本手册 (How to Use this Playbook)

The first thing we need to do is obtain the WordPress on LAMP playbook and its dependencies from the do-community/ansible-playbooks repository. We need to clone this repository to a local folder inside the Ansible Control Node.

我们需要做的第一件事是从do-community / ansible-playbooks存储库中获得LAMP剧本上的WordPress及其依赖项。 我们需要将此存储库克隆到Ansible控制节点内的本地文件夹。

In case you have cloned this repository before while following a different guide, access your existing ansible-playbooks copy and run a git pull command to make sure you have updated contents:

如果您在遵循其他指南之前已经克隆了此存储库,请访问现有的ansible-playbooks副本并运行git pull命令以确保已更新内容:

  • cd ~/ansible-playbooks

    cd〜/ ansible-playbooks
  • git pull

    git pull

If this is your first time using the do-community/ansible-playbooks repository, you should start by cloning the repository to your home folder with:

如果这是您第一次使用do-community/ansible-playbooks存储库,则应首先使用以下命令将存储库克隆到主文件夹中:

  • cd ~

    光盘〜
  • git clone https://github.com/do-community/ansible-playbooks.git

    git clone https://github.com/do-community/ansible-playbooks.git
  • cd ansible-playbooks

    cd ansible-playbooks

The files we’re interested in are located inside the wordpress-lamp_ubuntu1804 folder, which has the following structure:

我们感兴趣的文件位于wordpress-lamp_ubuntu1804文件夹中,该文件夹具有以下结构:

wordpress-lamp_ubuntu1804
├── files
│   ├── apache.conf.j2
│   └── wp-config.php.j2
├── vars
│   └── default.yml
├── playbook.yml
└── readme.md

Here is what each of these files are:

以下是每个文件的含义:

  • files/apache.conf.j2: Template file for setting up the Apache VirtualHost.

    files/apache.conf.j2 :用于设置Apache VirtualHost的模板文件。

  • files/wp-config.php.j2: Template file for setting up WordPress’s configuration file.

    files/wp-config.php.j2 :用于设置WordPress配置文件的模板文件。

  • vars/default.yml: Variable file for customizing playbook settings.

    vars/default.yml :用于自定义剧本设置的变量文件。

  • playbook.yml: The playbook file, containing the tasks to be executed on the remote server(s).

    playbook.yml :剧本文件,包含要在远程服务器上执行的任务。

  • readme.md: A text file containing information about this playbook.

    readme.md :一个文本文件,包含有关此剧本的信息。

We’ll edit the playbook’s variable file to customize its options. Access the wordpress-lamp_ubuntu1804 directory and open the vars/default.yml file using your command line editor of choice:

我们将编辑剧本的变量文件以自定义其选项。 使用您选择的命令行编辑器访问wordpress-lamp_ubuntu1804目录并打开vars/default.yml文件:

  • cd wordpress-lamp_ubuntu1804

    cd wordpress-lamp_ubuntu1804
  • nano vars/default.yml

    纳米vars / default.yml

This file contains a few variables that require your attention:

该文件包含一些需要引起您注意的变量:

vars/default.yml
vars / default.yml
---
#System Settings
php_modules: [ 'php-curl', 'php-gd', 'php-mbstring', 'php-xml', 'php-xmlrpc', 'php-soap', 'php-intl', 'php-zip' ]

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

#HTTP Settings
http_host: "your_domain"
http_conf: "your_domain.conf"
http_port: "80"

The following list contains a brief explanation of each of these variables and how you might want to change them:

以下列表简要说明了每个变量以及如何更改它们:

  • php_modules: An array containing PHP extensions that should be installed to support your WordPress setup. You don’t need to change this variable, but you might want to include new extensions to the list if your specific setup requires it.

    php_modules :一个包含PHP扩展名的数组,应安装该扩展名以支持WordPress设置。 您不需要更改此变量,但是如果您的特定设置需要此变量,则可能需要在列表中包括新的扩展名。

  • mysql_root_password: The desired password for the root MySQL account.

    mysql_root_password MySQL帐户的所需密码。

  • mysql_db: The name of the MySQL database that should be created for WordPress.

    mysql_db :应该为WordPress创建MySQL数据库的名称。

  • mysql_user: The name of the MySQL user that should be created for WordPress.

    mysql_user :应该为WordPress创建MySQL用户的名称。

  • mysql_password: The password for the new MySQL user.

    mysql_password :新MySQL用户的密码。

  • http_host: Your domain name.

    http_host :您的域名。

  • http_conf: The name of the configuration file that will be created within Apache.

    http_conf :将在Apache中创建的配置文件的名称。

  • http_port: HTTP port for this virtual host, where 80 is the default.

    http_port :此虚拟主机的HTTP端口,默认值为80

Once you’re done updating the variables inside vars/default.yml, save and close this file. If you used nano, do so by pressing CTRL + X, Y, then ENTER.

更新完vars/default.yml的变量后,保存并关闭此文件。 如果您使用过nano ,请按CTRL + XY ,然后按ENTER

You’re now ready to run this playbook on one or more servers. Most playbooks are configured to be executed on every server in your inventory, by default. We can use the -l flag to make sure that only a subset of servers, or a single server, is affected by the playbook. We can also use the -u flag to specify which user on the remote server we’re using to connect and execute the playbook commands on the remote hosts.

现在,您可以在一个或多个服务器上运行此剧本。 默认情况下,大多数剧本配置为在清单中的每台服务器上执行。 我们可以使用-l标志来确保只有一部分服务器或单个服务器受该剧本的影响。 我们还可以使用-u标志来指定用于连接和执行远程主机上的playbook命令的远程服务器上的哪个用户。

To execute the playbook only on server1, connecting as sammy, you can use the following command:

要仅在以sammy连接的server1上执行剧本,可以使用以下命令:

  • ansible-playbook playbook.yml -l server1 -u sammy

    ansible-playbook playbook.yml -l server1 -u sammy

You will get output similar to this:

您将获得类似于以下的输出:


   
Output
PLAY [all] ***************************************************************************************************************************** TASK [Gathering Facts] ***************************************************************************************************************** ok: [server1] TASK [Install prerequisites] *********************************************************************************************************** ok: [server1] … TASK [Download and unpack latest WordPress] ******************************************************************************************** changed: [server1] TASK [Set ownership] ******************************************************************************************************************* changed: [server1] TASK [Set permissions for directories] ************************************************************************************************* changed: [server1] TASK [Set permissions for files] ******************************************************************************************************* changed: [server1] TASK [Set up wp-config] **************************************************************************************************************** changed: [server1] RUNNING HANDLER [Reload Apache] ******************************************************************************************************** changed: [server1] RUNNING HANDLER [Restart Apache] ******************************************************************************************************* changed: [server1] PLAY RECAP ***************************************************************************************************************************** server1 : ok=22 changed=18 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

Note: For more information on how to run Ansible playbooks, check our Ansible Cheat Sheet Guide.

注意 :有关如何运行Ansible剧本的更多信息,请参阅《 Ansible备忘单指南》 。

When the playbook is finished running, you can go to your web browser to finish WordPress’s installation from there.

当剧本运行完毕后,您可以转到网络浏览器从那里完成WordPress的安装。

Navigate to your server’s domain name or public IP address:

导航到服务器的域名或公共IP地址:

http://server_host_or_IP

You will see a page like this:

您将看到如下页面:

After selecting the language you’d like to use for your WordPress installation, you’ll be presented with a final step to set up your WordPress user and password so you can log into your control panel:

在选择了要用于WordPress安装的语言之后,将为您提供设置WordPress用户和密码的最后一步,以便您可以登录到控制面板:

When you click ahead, you will be taken to a page that prompts you to log in:

当您单击前进时,将转到一个页面,提示您登录:

Once you log in, you will be taken to the WordPress administration dashboard:

登录后,您将被带到WordPress管理仪表板:

Some common next steps for customizing your WordPress installation include choosing the permalinks setting for your posts (can be found in Settings > Permalinks) and selecting a new theme (in Appearance > Themes).

定制WordPress安装的一些常见后续步骤包括选择帖子的永久链接设置(可以在Settings > Permalinks找到)和选择新主题(在Appearance > Themes )。

剧本内容 (The Playbook Contents)

You can find the WordPress on LAMP server setup featured in this tutorial in the wordpress-lamp_ubuntu1804 folder inside the DigitalOcean Community Playbooks repository. To copy or download the script contents directly, click the Raw button towards the top of each script.

您可以在DigitalOcean Community Playbooks存储库内的wordpress-lamp_ubuntu1804文件夹中找到本教程中介绍的LAMP服务器设置上的wordpress-lamp_ubuntu1804 。 要直接复制或下载脚本内容,请单击每个脚本顶部的Raw按钮。

The full contents of the playbook as well as its associated files are also included here for your convenience.

为了方便起见,此处也包含了剧本的完整内容及其相关文件。

vars / default.yml (vars/default.yml)

The default.yml variable file contains values that will be used within the playbook tasks, such as the database settings and the domain name to configure within Apache.

default.yml变量文件包含将在剧本任务中使用的值,例如数据库设置和要在Apache中配置的域名。

vars/default.yml
vars / default.yml
#System Settings
php_modules: [ 'php-curl', 'php-gd', 'php-mbstring', 'php-xml', 'php-xmlrpc', 'php-soap', 'php-intl', 'php-zip' ]

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

#HTTP Settings
http_host: "your_domain"
http_conf: "your_domain.conf"
http_port: "80"

文件/apache.conf.j2 (files/apache.conf.j2)

The apache.conf.j2 file is a Jinja 2 template file that configures a new Apache VirtualHost. The variables used within this template are defined in the vars/default.yml variable file.

apache.conf.j2文件是Jinja 2模板文件,用于配置新的Apache VirtualHost。 在vars/default.yml变量文件中定义了此模板中使用的变量。

files/apache.conf.j2
文件/apache.conf.j2
<VirtualHost *:{{ http_port }}>
   ServerAdmin webmaster@localhost
   ServerName {{ http_host }}
   ServerAlias www.{{ http_host }}
   DocumentRoot /var/www/{{ http_host }}
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined

   <Directory /var/www/{{ http_host }}>
         Options -Indexes
   </Directory>

   <IfModule mod_dir.c>
       DirectoryIndex index.php index.html index.cgi index.pl  index.xhtml index.htm
   </IfModule>

</VirtualHost>

文件/ wp-config.php.j2 (files/wp-config.php.j2)

The wp-config.php.j2 file is another Jinja template, used to set up the main configuration file used by WordPress. The variables used within this template are defined in the vars/default.yml variable file. Unique authentication keys and salts are generated using a hash function.

wp-config.php.j2文件是另一个Jinja模板,用于设置WordPress使用的主要配置文件。 在vars/default.yml变量文件中定义了此模板中使用的变量。 使用哈希函数生成唯一的身份验证密钥和盐。

files/info.php.j2
文件/ info.php.j2
<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the
 * installation. You don't have to use the web site, you can
 * copy this file to "wp-config.php" and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * MySQL settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://codex.wordpress.org/Editing_wp-config.php
 *
 * @package WordPress
 */

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', '{{ mysql_db }}' );

/** MySQL database username */
define( 'DB_USER', '{{ mysql_user }}' );

/** MySQL database password */
define( 'DB_PASSWORD', '{{ mysql_password }}' );

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

/** Filesystem access **/
define('FS_METHOD', 'direct');

/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define( 'AUTH_KEY',         '{{ lookup('password', '/dev/null chars=ascii_letters length=64') }}' );
define( 'SECURE_AUTH_KEY',  '{{ lookup('password', '/dev/null chars=ascii_letters length=64') }}' );
define( 'LOGGED_IN_KEY',    '{{ lookup('password', '/dev/null chars=ascii_letters length=64') }}' );
define( 'NONCE_KEY',        '{{ lookup('password', '/dev/null chars=ascii_letters length=64') }}' );
define( 'AUTH_SALT',        '{{ lookup('password', '/dev/null chars=ascii_letters length=64') }}' );
define( 'SECURE_AUTH_SALT', '{{ lookup('password', '/dev/null chars=ascii_letters length=64') }}' );
define( 'LOGGED_IN_SALT',   '{{ lookup('password', '/dev/null chars=ascii_letters length=64') }}' );
define( 'NONCE_SALT',       '{{ lookup('password', '/dev/null chars=ascii_letters length=64') }}' );

/**#@-*/

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the Codex.
 *
 * @link https://codex.wordpress.org/Debugging_in_WordPress
 */
define( 'WP_DEBUG', false );

/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
    define( 'ABSPATH', dirname( __FILE__ ) . '/' );
}

/** Sets up WordPress vars and included files. */
require_once( ABSPATH . 'wp-settings.php' );

playbook.yml (playbook.yml)

The playbook.yml file is where all tasks from this setup are defined. It starts by defining the group of servers that should be the target of this setup (all), after which it uses become: true to define that tasks should be executed with privilege escalation (sudo) by default. Then, it includes the vars/default.yml variable file to load configuration options.

playbook.yml文件中,定义了此设置中的所有任务。 它首先定义应作为此设置目标的服务器组( all ),然后使用become: true定义默认情况下应以特权升级( sudo )执行任务。 然后,它包含vars/default.yml变量文件以加载配置选项。

playbook.yml
playbook.yml
---
- hosts: all
  become: true
  vars_files:
    - vars/default.yml

  tasks:
    - name: Install prerequisites
      apt: name=aptitude update_cache=yes state=latest force_apt_get=yes
      tags: [ system ]

    - name: Install LAMP Packages
      apt: name={{ item }} update_cache=yes state=latest
      loop: [ 'apache2', 'mysql-server', 'python3-pymysql', 'php', 'php-mysql', 'libapache2-mod-php' ]
      tags: [ system ]

    - name: Install PHP Extensions
      apt: name={{ item }} update_cache=yes state=latest
      loop: "{{ php_modules }}"
      tags: [ system ]

  # Apache Configuration
    - name: Create document root
      file:
        path: "/var/www/{{ http_host }}"
        state: directory
        owner: "www-data"
        group: "www-data"
        mode: '0755'
      tags: [ apache ]

    - name: Set up Apache VirtualHost
      template:
        src: "files/apache.conf.j2"
        dest: "/etc/apache2/sites-available/{{ http_conf }}"
      notify: Reload Apache
      tags: [ apache ]

    - name: Enable rewrite module
      shell: /usr/sbin/a2enmod rewrite
      notify: Reload Apache
      tags: [ apache ]

    - name: Enable new site
      shell: /usr/sbin/a2ensite {{ http_conf }}
      notify: Reload Apache
      tags: [ apache ]

    - name: Disable default Apache site
      shell: /usr/sbin/a2dissite 000-default.conf
      notify: Restart Apache
      tags: [ apache ]

  # MySQL Configuration
    - name: Set the root password
      mysql_user:
        name: root
        password: "{{ mysql_root_password }}"
        login_unix_socket: /var/run/mysqld/mysqld.sock
      tags: [ mysql, mysql-root ]

    - name: Remove all anonymous user accounts
      mysql_user:
        name: ''
        host_all: yes
        state: absent
        login_user: root
        login_password: "{{ mysql_root_password }}"
      tags: [ mysql ]

    - name: Remove the MySQL test database
      mysql_db:
        name: test
        state: absent
        login_user: root
        login_password: "{{ mysql_root_password }}"
      tags: [ mysql ]

    - name: Creates database for WordPress
      mysql_db:
        name: "{{ mysql_db }}"
        state: present
        login_user: root
        login_password: "{{ mysql_root_password }}"
      tags: [ mysql ]

    - name: Create MySQL user for WordPress
      mysql_user:
        name: "{{ mysql_user }}"
        password: "{{ mysql_password }}"
        priv: "{{ mysql_db }}.*:ALL"
        state: present
        login_user: root
        login_password: "{{ mysql_root_password }}"
      tags: [ mysql ]

  # UFW Configuration
    - name: "UFW - Allow HTTP on port {{ http_port }}"
      ufw:
        rule: allow
        port: "{{ http_port }}"
        proto: tcp
      tags: [ system ]

  # WordPress Configuration
    - name: Download and unpack latest WordPress
      unarchive:
        src: https://wordpress.org/latest.tar.gz
        dest: "/var/www/{{ http_host }}"
        remote_src: yes
        creates: "/var/www/{{ http_host }}/wordpress"
      tags: [ wordpress ]

    - name: Set ownership
      file:
        path: "/var/www/{{ http_host }}"
        state: directory
        recurse: yes
        owner: www-data
        group: www-data
      tags: [ wordpress ]

    - name: Set permissions for directories
      shell: "/usr/bin/find /var/www/{{ http_host }}/wordpress/ -type d -exec chmod 750 {} \\;"
      tags: [ wordpress ]

    - name: Set permissions for files
      shell: "/usr/bin/find /var/www/{{ http_host }}/wordpress/ -type f -exec chmod 640 {} \\;"
      tags: [ wordpress ]

    - name: Set up wp-config
      template:
        src: "files/wp-config.php.j2"
        dest: "/var/www/{{ http_host }}/wordpress/wp-config.php"
      tags: [ wordpress ]

  handlers:
    - name: Reload Apache
      service:
        name: apache2
        state: reloaded

    - name: Restart Apache
      service:
        name: apache2
        state: restarted

Feel free to modify these files to best suit your individual needs within your own workflow.

随意修改这些文件以最适合您自己的工作流程中的个性化需求。

结论 (Conclusion)

In this guide, we used Ansible to automate the process of installing and setting up a WordPress website with LAMP on an Ubuntu 18.04 server.

在本指南中,我们使用Ansible自动化了在Ubuntu 18.04服务器上使用LAMP安装和设置WordPress网站的过程。

If you’d like to include other tasks in this playbook to further customize your server setup, please refer to our introductory Ansible guide Configuration Management 101: Writing Ansible Playbooks.

如果您想在本手册中包括其他任务以进一步自定义服务器设置,请参阅我们的Ansible入门指南Configuration Management 101:编写Ansible手册 。

翻译自: https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-install-and-set-up-wordpress-with-lamp-on-ubuntu-18-04


http://www.niftyadmin.cn/n/3649134.html

相关文章

Windows文本框星号密码查看器

Windows文本框星号密码查看器本人2002的学习作品作者&#xff1a;成晓旭1、 设计原理&#xff1a;注册一个系统级鼠标挂钩&#xff0c;通过监测系统鼠标所在Windows窗口来获取密码&#xff0c;成功获取密码之后&#xff0c;通过发送自定义的Windows系统消息&#xff0c;到宿主…

Celery 链接RabbitMQ报错CRITICAL/MainProcess] Frequent restarts detected: RestartFreqExceeded('5 in 1s',)

为了别人&#xff0c;也是为了将来自己忘了&#xff0c;备忘一个问题 在实现Celery链接RabbitMQ的时候&#xff0c;感觉万事具备了&#xff0c;却报错&#xff1a; CRITICAL/MainProcess] Frequent restarts detected: RestartFreqExceeded(5 in 1s,) raceback (most recent ca…

简单使用style实现沉浸式状态栏

我之前也写过一个沉浸式的文章&#xff1a;http://blog.csdn.net/qq_24675479/article/details/78557698 今天写一个比较简单点的&#xff1a; 默认情况下的style&#xff1a; <resources><!-- Base application theme. --><style name"AppTheme" p…

ts构建koa_如何使用Koa构建“ Hello World”应用程序

ts构建koa介绍 (Introduction) Express is one of the most popular Node.js frameworks out there. Koa is a new web framework created by the team behind Express. It aims to be a modern and more minimalist version of Express. Some of its characteristics are its …

新旧身份证合法性验证及相互转换算法

新旧身份证合法性验证及相互转换算法——谨以此文献给共事3年即将离职的PPL作者&#xff1a;成晓旭前天&#xff0c;看到PPL在一个需要网站上注册&#xff0c;但该网站要求输入一个身份证号码&#xff0c;并且随便输入一个还不行&#xff1a;对方还要验证输入身份证的合法性&am…

实现头部透明度变化

首先布局:布局很简单 <?xml version"1.0" encoding"utf-8"?> <RelativeLayout xmlns:android"http://schemas.android.com/apk/res/android"xmlns:tools"http://schemas.android.com/tools"android:layout_width"matc…

[Perl]测试程序时用Perl真是太方便了

测试自己的业务数据远程传送服务&#xff0c;需要一个能模拟对方Socket的服务&#xff0c;这时候就显出Perl的便利了。一分钟搞定。代码如下&#xff0c;其实也是从CPAN那里拿来的&#xff1a;###################################################################### 工程项目…

如何使用Node.js抓取网站

介绍 (Introduction) Web scraping is the technique of extracting data from websites. This data can further be stored in a database or any other storage system for analysis or other uses. While extracting data from websites can be done manually, web scraping…