A multi-tier application pattern might require a Wordpress service. This task creates a service that installs a Wordpress application inside the Apache component.

Procedure

  1. Log in to the vRealize Automation Rainpole portal.
    1. Open a Web browser and go to https://vra01svr01.rainpole.local/vcac/org/rainpole.
    2. Log in using the following credentials.

      Setting

      Value

      User name

      vra-admin-rainpole

      Password

      vra-admin-rainpole_password

      Domain

      rainpole.local

  2. Click New to create a new service.
  3. Under General, enter the following values and click Next.

    Setting

    Value

    Name

    Wordpress Service

    Description

    Install and configure Wordpress services inside the Apache service.

    Container

    Apache Service

  4. Under Properties, click New to add a property for the Wordpress user.

    Setting

    Value

    Name

    WP_DB_USER

    Type

    String

    Value

    wordpressuser

    Encrypted

    No

    Overridable

    Yes

    Required

    No

    Computed

    No

  5. Under Properties click New to add a property for the Wordpress password.

    Setting

    Value

    Name

    WP_DB_PASSWORD

    Type

    String

    Value

    gogo123

    Encrypted

    Yes

    Overridable

    Yes

    Required

    No

    Computed

    No

  6. Under Properties click New to add a property for the Wordpress database.

    Setting

    Value

    Name

    WP_DB_NAME

    Type

    String

    Value

    wordpress

    Encrypted

    No

    Overridable

    Yes

    Required

    No

    Computed

    No

  7. Under Properties click New to add a property for the Wordpress database host.

    Setting

    Value

    Name

    WP_DB_HOST

    Type

    String

    Value

    localhost

    Encrypted

    No

    Overridable

    Yes

    Required

    No

    Computed

    No

  8. Click Next.
  9. Set the actions for this service in the Actions pane.
    1. In the Install row, select Bash as the Script Type.
    2. Still in the Install row, select Click Here to edit, paste the following code into the Edit Script text box, and click OK.
      cd /tmp
      /usr/bin/wget http://wordpress.org/latest.tar.gz --output-document=/tmp/latest.tar.gz
      /bin/tar -xzvf /tmp/latest.tar.gz
      mv /tmp/wordpress/* /var/www/html/
    3. In Configure lifecycle row, click Click here to Edit and paste the following script fragment.
      cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
      /bin/sed -i "s/database_name_here/$WP_DB_NAME/g" /var/www/html/wp-config.php
      /bin/sed -i "s/username_here/$WP_DB_USER/g" /var/www/html/wp-config.php
      /bin/sed -i "s/password_here/$WP_DB_PASSWORD/g" /var/www/html/wp-config.php
      /bin/sed -i "s/localhost/$WP_DB_HOST/g" /var/www/html/wp-config.php
  10. Click OK, click Next and click Finish.
  11. Select the new service and click Publish.