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:
-
Make sure that you have the permissions to Create a Schematics actions.
-
Create an IBM Cloud® Virtual Private Cloud and a Virtual Servers for VPC. For more information, see Getting started with Virtual Private Cloud (VPC).
Note your Private or Floating IP address of your Virtual Servers for VPC.
Starting and stopping Virtual Servers for VPC
- Log in to IBM Cloud console.
- Click the Menu icon > Platform Automation > Schematics > Ansible.
- 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. - Click Edit icon and enter
https://github.com/Cloud-Schematics/ansible-is-instance-actions
in the GitHub or GitLab repository URL field. - Click Retrieve playbooks.
- Select the
stop-vsi-playbook.yaml
playbook. see floating IP address of the VSI to set your input variable. - Expand the Advanced options.
- 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. - Click Save.
- 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.
- 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.
- Verify that your Virtual Servers for VPC stopped.
- From the Virtual Servers for VPC dashboard, find your Virtual Servers for VPC.
- Verify that your instance shows a
Stopped
status.
- 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:
- Learn how to create your own Ansible playbooks.
- Explore other IBM-provided playbooks.
- Set up the Schematics CLI or API to start automating the configuration of IBM Cloud resources.