IBM Cloud Docs
Using actions to perform configuration management

Using actions to perform configuration management

Use one of the IBM® provided Ansible playbooks to start and stop IBM Cloud® Virtual Servers for Virtual Private Cloud.

An Ansible playbook is a set of instructions or automation tasks that you can configure to run on a single target host or a group of hosts. You create a Schematics action that points to your playbook and use the built-in Ansible capabilities in to run the instructions in your playbook. For more information about how Schematics runs your Ansible playbooks? see Configuration management with IBM Cloud Schematics.

Before you begin

Before you can use this Ansible playbook, you must complete the following tasks:

Starting and stopping Virtual Servers for VPC

  1. From the Schematics actions page. Click Create action.
  2. Enter a name for your action, for example, Stop_VSIaction, resource group, and the region where you want to create the action. Then, click Create to view the Details section.
  3. In the Ansible playbook section, click Edit icon and enter https://github.com/Cloud-Schematics/ansible-is-instance-actions in the GitHub or GitLab repository URL field.
  4. Click Retrieve playbooks.
  5. Select the stop-vsi-playbook.yaml playbook. see floating IP address of the VSI to set your input variable.
  6. Expand the Advanced options.
  7. In the Define your variables section, enter instance_ip as the key and the floating IP address of your Virtual Servers for VPC as the value.
  8. Click Save.
  9. Click Check action to verify your action details. The Jobs page opens automatically and you can view the results of this check by looking at the logs.
  10. Click Run action to stop the Virtual Servers for VPC. You can monitor the progress of this action by reviewing the logs on the Jobs page.
  11. Verify that your Virtual Servers for VPC stopped.
    1. From the Virtual Servers for VPC dashboard, find your Virtual Servers for VPC.
    2. Verify that your instance shows a Stopped status.
  12. Optional: Repeat the steps in this getting started tutorial to create another action, and select the start-vsi-playbook.yaml Ansible playbook to start your Virtual Servers for VPC again.

You used the built-in Ansible capabilities of Schematics to start and stop a Virtual Servers for VPC instance.

What's next?

Now that you ran your first operation on an IBM Cloud resource, you can explore the following options: