salt.states.libcloud_loadbalancer module

Apache Libcloud Load Balancer State

Manage load balancers using libcloud

codeauthor

Anthony Shaw <anthonyshaw@apache.org>

Apache Libcloud load balancer management for a full list of supported clouds, see http://libcloud.readthedocs.io/en/latest/loadbalancer/supported_providers.html

Clouds include Amazon ELB, ALB, Google, Aliyun, CloudStack, Softlayer

New in version 2018.3.0.

configuration

This module uses a configuration profile for one or multiple Cloud providers

libcloud_loadbalancer:
    profile_test1:
      driver: gce
      key: GOOG0123456789ABCXYZ
      secret: mysecret
    profile_test2:
      driver: alb
      key: 12345
      secret: mysecret

Example:

Using States to deploy a load balancer with extended arguments to specify region

lb_test:
    libcloud_loadbalancer.balancer_present:
        - name: example
        - port: 80
        - protocol: http
        - profile: google
        - ex_region: us-east1
depends

apache-libcloud

salt.states.libcloud_loadbalancer.balancer_absent(name, profile, **libcloud_kwargs)

Ensures a load balancer is absent.

Parameters
  • name (str) -- Load Balancer name

  • profile (str) -- The profile key

salt.states.libcloud_loadbalancer.balancer_present(name, port, protocol, profile, algorithm=None, members=None, **libcloud_kwargs)

Ensures a load balancer is present.

Parameters
  • name (str) -- Load Balancer name

  • port (str) -- Port the load balancer should listen on, defaults to 80

  • protocol (str) -- Loadbalancer protocol, defaults to http.

  • profile (str) -- The profile key

  • algorithm (str) -- Load balancing algorithm, defaults to ROUND_ROBIN. See Algorithm type in Libcloud documentation for a full listing.

  • members (list of dict (ip, port)) -- An optional list of members to create on deployment

salt.states.libcloud_loadbalancer.member_absent(ip, port, balancer_id, profile, **libcloud_kwargs)

Ensure a load balancer member is absent, based on IP and Port

Parameters
  • ip (str) -- IP address for the member

  • port (int) -- Port for the member

  • balancer_id (str) -- id of a load balancer you want to detach the member from

  • profile (str) -- The profile key

salt.states.libcloud_loadbalancer.member_present(ip, port, balancer_id, profile, **libcloud_kwargs)

Ensure a load balancer member is present

Parameters
  • ip (str) -- IP address for the new member

  • port (int) -- Port for the new member

  • balancer_id (str) -- id of a load balancer you want to attach the member to

  • profile (str) -- The profile key

salt.states.libcloud_loadbalancer.state_result(result, message, name, changes=None)