cs_router – Manages routers on Apache CloudStack based clouds¶
- Start, restart, stop and destroy routers.
- state=present is not able to create routers, use cs_network instead.
The below requirements are needed on the host that executes this module.
- python >= 2.6
- cs >= 0.6.10
- Ansible uses the
cslibrary’s configuration method if credentials are not provided by the arguments
api_secret. Configuration is read from several locations, in the following order. The
CLOUDSTACK_TIMEOUTenvironment variables. A
CLOUDSTACK_CONFIGenvironment variable pointing to an
cloudstack.inifile in the current working directory. A
.cloudstack.inifile in the users home directory. Optionally multiple credentials and endpoints can be specified using ini sections in
cloudstack.ini. Use the argument
api_regionto select the section name, default section is
cloudstack. See https://github.com/exoscale/cs for more information.
- A detailed guide about cloudstack modules can be found in the CloudStack Cloud Guide.
- This module supports check mode.
# Ensure the router has the desired service offering, no matter if # the router is running or not. - name: Present router cs_router: name: r-40-VM service_offering: System Offering for Software Router delegate_to: localhost - name: Ensure started cs_router: name: r-40-VM state: started delegate_to: localhost # Ensure started with desired service offering. # If the service offerings changes, router will be rebooted. - name: Ensure started with desired service offering cs_router: name: r-40-VM service_offering: System Offering for Software Router state: started delegate_to: localhost - name: Ensure stopped cs_router: name: r-40-VM state: stopped delegate_to: localhost - name: Remove a router cs_router: name: r-40-VM state: absent delegate_to: localhost
Common return values are documented here, the following are the fields unique to this module: