Logo Help Center
    Sign in
      1. CloudShare Support
      2. Integrations
      3. Use Ansible to Manage Servers
      • Use Ansible to Manage Servers

      Use Ansible to Manage Servers
      Follow New articles New articles and comments

      Use Ansible to Manage Servers

      • One of many uses for Ansible is server management, and one of the great things we've done at CloudShare is to integrate with Ansible so that you can use Ansible to manage your CloudShare VMs in yo...

      Installation

      • Download cloudshare-inv.py. This is the CloudShare dynamic inventory script. Install the CloudShare Python SDK: pip install cloudshare. Define your CloudShare API keys as environment variables: C...

      Usage

      • To retrieve all VMs in all CloudShare environments and their login credentials: ansible -i cloudshare-inv.py all -m ping To limit the output to a specific environment: ansible -i cloudshare-inv.py...

      Example - Running the Inventory Script

      • Run the inventory script on its own to generate a list of environments, VMs and VM login credentials: ansible -i cloudshare-inv.py all -m ping The output is a JSON document that looks like this: {...

      Example - Running a Playbook

      • Let’s say you have a playbook called web-app.yml that you wish to run on one your VMs. Using the dynamic inventory, you can do this: ansible-playbook -i cloudshare-inventory.py all web-app.yml Th...

      Example - Running Ad-Hoc Commands

      • Something you probably find yourself doing from time to time is to apply patches to your servers. In this example we have an environment called chat-demo containing a few Ubuntu Linux VMs, and we ...

      Quick Links

      • Play Sound on a Windows VM over RDP
      • Customizing the Environment Viewer (Enterprise)
      • Upgrading a Network Adapter

      Support

      • Tips and Troubleshooting
      • My activities
      • Submit a request

      Copyright © CloudShare, Inc. All rights reserved.