community.general.packet_project (8.5.0) — module

Create/delete a project in Packet host

| "added in version" 0.2.0 of community.general"

Authors: Tomas Karasek (@t0mk) <tom.to.the.k@gmail.com>, Nurfet Becirevic (@nurfet-becirevic) <nurfet.becirevic@gmail.com>

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Create/delete a project in Packet host.

API is documented at U(https://www.packet.com/developers/api/#projects).


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# All the examples assume that you have your Packet API token in env var PACKET_API_TOKEN.
# You can also pass the api token in module param auth_token.

- name: Create new project
  hosts: localhost
  tasks:
    community.general.packet_project:
      name: "new project"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create new project within non-default organization
  hosts: localhost
  tasks:
    community.general.packet_project:
      name: "my org project"
      org_id: a4cc87f9-e00f-48c2-9460-74aa60beb6b0
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove project by id
  hosts: localhost
  tasks:
    community.general.packet_project:
      state: absent
      id: eef49903-7a09-4ca1-af67-4087c29ab5b6
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create new project with non-default billing method
  hosts: localhost
  tasks:
    community.general.packet_project:
      name: "newer project"
      payment_method: "the other visa"

Inputs

    
id:
    description:
    - UUID of the project which you want to remove.
    type: str

name:
    description:
    - Name for/of the project.
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Indicate desired state of the target.
    type: str

org_id:
    description:
    - UUID of the organization to create a project for.
    - When blank, the API assumes the default organization.
    type: str

auth_token:
    description:
    - Packet api token. You can also supply it in environment variable E(PACKET_API_TOKEN).
    type: str

custom_data:
    description:
    - Custom data about the project to create.
    type: str

payment_method:
    description:
    - Payment method is name of one of the payment methods available to your user.
    - When blank, the API assumes the default payment method.
    type: str

Outputs

changed:
  description: True if a project was created or removed.
  returned: success
  sample: true
  type: bool
id:
  description: UUID of addressed project.
  returned: success
  type: str
name:
  description: Name of addressed project.
  returned: success
  type: str