A multi-tier application pattern might require a database. This task creates a service that installs and configures a MySQL server on a Linux virtual machine.
Procedure
- Log in to the vRealize Automation Rainpole portal.
- Open a Web browser and go to https://vra01svr01.rainpole.local/vcac/org/rainpole.
- Log in using the following credentials.
Setting
Value
User name
vra-admin-rainpole
Password
vra-admin-rainpole_password
Domain
rainpole.local
- Click New to create a new software component.
- Under General enter the following values and click Next.
Setting
Value
Name
MySQL
Description
MySQL Service Installation and Configuration
Container
Machine
- Under Properties click New, enter the following values, click OK, and then click Next.
Setting
Value
Name
dbpassword
Description
Root Password
Type
String
Value
gogo123
Encrypted
Yes
Overridable
Yes
Required
No
Computed
No
- Click OK and click Next.
- Set the actions for this service in the Actions pane.
- In the Install row, select Bash as the Script Type.
- Still in the Install row, select Click Here to edit and paste the following code into the Edit Script text box.
#!/bin/bash /usr/bin/yum -y install mysql-server mysql-client /sbin/chkconfig mysqld on /sbin/service mysqld start
- In the Configure row, select Click here to Edit and paste the following code into the text box.
#!/bin/bash /usr/bin/mysql -e "UPDATE mysql.user SET Password=PASSWORD('$dbpassword') WHERE User='root';" /usr/bin/mysql -e "DELETE FROM mysql.user WHERE User='';" /usr/bin/mysql -e "DROP DATABASE test;" /usr/bin/mysql -e "FLUSH PRIVILEGES;"
- In the Install row, select Bash as the Script Type.
- Click Next and click Finish.
- Select the new MySQL service and click Publish.