copyright | lastupdated | keywords | subcollection | ||
---|---|---|---|---|---|
|
2025-01-17 |
get started with schematics, infrastructure management, infrastructure as code, iac, schematics cloud environment, schematics infrastructure, schematics terraform, terraform provider |
schematics |
{{site.data.keyword.attribute-definition-list}}
{: #getting-started-ansible}
Use one of the {{site.data.keyword.IBM}} provided Ansible playbooks to start and stop {{site.data.keyword.vsi_is_full}}. {: shortdesc}
An Ansible playbook{: external} 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 {{site.data.keyword.bpshort}} 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 {{site.data.keyword.bpshort}} runs your Ansible playbooks? see Configuration management with {{site.data.keyword.bplong_notm}}.
{: #ansible-prereq}
Before you can use this Ansible playbook, you must complete the following tasks:
-
Make sure that you have the permissions to Create a {{site.data.keyword.bpshort}} actions.
-
Create an {{site.data.keyword.vpc_full}} and a {{site.data.keyword.vsi_is_short}}. For more information, see Getting started with Virtual Private Cloud (VPC){: external}.
Note your Private or Floating IP address of your {{site.data.keyword.vsi_is_short}}. {: note}
{: #ansible-vsi}
- Log in to {{site.data.keyword.cloud_notm}} console{: external}.
- Click the Menu icon
> Platform Automation > Schematics > Ansible{: external}.
- 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{: external} 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 {{site.data.keyword.vsi_is_short}} 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 {{site.data.keyword.vsi_is_short}}. You can monitor the progress of this action by reviewing the logs on the Jobs page.
- Verify that your {{site.data.keyword.vsi_is_short}} stopped.
- From the {{site.data.keyword.vsi_is_short}} dashboard{: external}, find your {{site.data.keyword.vsi_is_short}}.
- 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 {{site.data.keyword.vsi_is_short}} again.
You used the built-in Ansible capabilities of {{site.data.keyword.bpshort}} to start and stop a {{site.data.keyword.vsi_is_short}} instance.
{: #ansible-whats-next}
Now that you ran first operation on an {{site.data.keyword.cloud_notm}} resource, you can explore the following options:
- Learn how to create your own Ansible playbooks.
- Explore other IBM-provided playbooks{: external}.
- Set up the {{site.data.keyword.bpshort}} CLI or API to start automating the configuration of {{site.data.keyword.cloud_notm}} resources.