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. Log in to IBM Cloud console.
  2. Click the Menu icon hamburger icon > Platform Automation > Schematics > Ansible.
  3. 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.
  4. Click Edit icon and enter https://github.com/Cloud-Schematics/ansible-is-instance-actions in the GitHub or GitLab repository URL field.
  5. Click Retrieve playbooks.
  6. Select the stop-vsi-playbook.yaml playbook. see floating IP address of the VSI to set your input variable.
  7. Expand the Advanced options.
  8. 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.
  9. Click Save.
  10. 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.
  11. 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.
  12. 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.
  13. 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: