For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create Ansible playbook

Create a new playbook.

post
Path parameters
orgstring · min: 1 · max: 128Required

Org is the organisation identifier.

Example: tfq
projectstring · min: 1 · max: 128Required

Project is the project identifier.

Example: qfw
Header parameters
Harness-Accountstring · min: 1 · max: 128Required

Account is the internal customer account ID.

Example: 7
Body
ansible_galaxybooleanOptional

Install Ansible Galaxy dependencies

Default: falseExample: true
ansible_galaxy_requirements_filestringOptional

Path to Ansible Galaxy requirements file

Example: requirements.yml
descriptionstring · max: 1024Optional

Description documents the playbook purpose and usage

Example: Playbook for deploying web services to production
identifierstringRequired

The unique identifier for this playbook

Example: Totam dolores deserunt illo.
namestring · min: 1 · max: 1024Required

Name is the human readable name

Example: test playbook
repositorystringOptional

Repository is the name of the repository to use.

Example: my-repo
repository_branchstringOptional

Repository Branch in which the playbook should be accessed.

Example: main
repository_commitstringOptional

Repository Commit/Tag in which the playbook should be accessed.

Example: abc10ed
repository_connectorstringOptional

Repository Connector is the reference to the connector to use for this playbook.

Example: my-connector
repository_pathstringRequired

Repository Path is the path in which the playbook resides.

Default: ""Example: playbooks/
tagsstring[]Optional

Tags associated with the playbook

Example: ["Occaecati molestiae.","Repellat provident aut vitae doloremque.","Deserunt exercitationem dolor labore ut.","Rerum non nulla eaque."]
Responses
201

Created response.

application/json
accountstring · min: 1 · max: 128Required

Account is the internal customer account ID.

Example: b
ansible_galaxybooleanOptional

Install Ansible Galaxy dependencies

Default: falseExample: true
ansible_galaxy_requirements_filestringOptional

Path to Ansible Galaxy requirements file

Example: requirements.yml
createdinteger · int64Required

Timestamp when the resource was created.

Example: 1627590400
descriptionstring · max: 1024Optional

Description documents the playbook purpose and usage

Example: Playbook for deploying web services to production
env_varsstringOptional

The environment vars in the playbook

Example: Et impedit dignissimos consequatur veniam delectus.
identifierstringRequired

The unique identifier for this playbook

Example: Porro facere nihil in nulla.
namestring · min: 1 · max: 1024Required

Name is the human readable name

Example: test playbook
orgstring · min: 1 · max: 128Required

Org is the organisation identifier.

Example: 2oh
projectstring · min: 1 · max: 128Required

Project is the project identifier.

Example: 3wi
repositorystringOptional

Repository is the name of the repository to use.

Example: my-repo
repository_branchstringOptional

Repository Branch in which the playbook should be accessed.

Example: main
repository_commitstringOptional

Repository Commit/Tag in which the playbook should be accessed.

Example: abc10ed
repository_connectorstringOptional

Repository Connector is the reference to the connector to use for this playbook.

Example: my-connector
repository_pathstringRequired

Repository Path is the path in which the playbook resides.

Default: ""Example: playbooks/
tagsstring[]Optional

Tags associated with the playbook

Example: ["Dolor voluptatem.","Dolores voluptatem ratione.","Repellat doloribus dolorem aut sapiente ratione.","Distinctio facere animi expedita."]
updatedinteger · int64Required

Timestamp when the resource was last updated.

Example: 1627686800
varsstringOptional

The vars in the playbook

Example: Velit corrupti id nisi.
post/api/orgs/{org}/projects/{project}/ansible/playbook
POST /api/orgs/{org}/projects/{project}/ansible/playbook HTTP/1.1
Host: localhost:80
Harness-Account: 7
Content-Type: application/json
Accept: */*
Content-Length: 1652

{
  "ansible_galaxy": false,
  "ansible_galaxy_requirements_file": "requirements.yml",
  "description": "Playbook for deploying web services to production",
  "env_vars": {
    "Beatae qui quam ipsam incidunt qui.": {
      "file_name": "Ut dolorum dignissimos fuga.",
      "key": "ip",
      "uuid": "123e4567-e89b-12d3-a456-426655440000",
      "value": "Et adipisci consequatur animi enim.",
      "value_type": "Voluptates molestiae odit expedita ea sed."
    },
    "Doloribus quidem quibusdam perspiciatis.": {
      "file_name": "Ut dolorum dignissimos fuga.",
      "key": "ip",
      "uuid": "123e4567-e89b-12d3-a456-426655440000",
      "value": "Et adipisci consequatur animi enim.",
      "value_type": "Voluptates molestiae odit expedita ea sed."
    }
  },
  "identifier": "Vitae commodi nisi maxime.",
  "name": "test playbook",
  "repository": "my-repo",
  "repository_branch": "main",
  "repository_commit": "abc10ed",
  "repository_connector": "my-connector",
  "repository_path": "playbooks/",
  "tags": [
    "Totam debitis facere voluptas iusto.",
    "Non deserunt."
  ],
  "vars": {
    "Fugit vitae adipisci.": {
      "file_name": "Ut dolorum dignissimos fuga.",
      "key": "ip",
      "uuid": "123e4567-e89b-12d3-a456-426655440000",
      "value": "Et adipisci consequatur animi enim.",
      "value_type": "Voluptates molestiae odit expedita ea sed."
    },
    "Quo distinctio consectetur unde.": {
      "file_name": "Ut dolorum dignissimos fuga.",
      "key": "ip",
      "uuid": "123e4567-e89b-12d3-a456-426655440000",
      "value": "Et adipisci consequatur animi enim.",
      "value_type": "Voluptates molestiae odit expedita ea sed."
    },
    "Tempora sint sit perferendis optio.": {
      "file_name": "Ut dolorum dignissimos fuga.",
      "key": "ip",
      "uuid": "123e4567-e89b-12d3-a456-426655440000",
      "value": "Et adipisci consequatur animi enim.",
      "value_type": "Voluptates molestiae odit expedita ea sed."
    }
  }
}
{
  "account": "1",
  "ansible_galaxy": false,
  "ansible_galaxy_requirements_file": "requirements.yml",
  "created": 1627590400,
  "description": "Playbook for deploying web services to production",
  "env_vars": "Sed earum voluptas non cum.",
  "identifier": "Ut est aliquid illum harum.",
  "name": "test playbook",
  "org": "7hd",
  "policy_evaluation": {
    "account_id": "XRQAjvT37acOiXx9PRaQMF",
    "action": "onrun",
    "created": 1636370209475,
    "details": [
      {
        "account_id": "eBqAoNchMLKigC_qZ5EdC",
        "action": "onrun",
        "created": 1636669297674,
        "description": "Captures critical production policies",
        "details": [
          {
            "deny_messages": [
              "deployment stage 'example-stage' does not have a HarnessApproval step",
              "deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"
            ],
            "output": "{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}",
            "policy": {
              "account_id": "eBqAoNchMLKigC_qZ5EdC",
              "created": 1636669297674,
              "identifier": "policy-1",
              "name": "Pipeline Approval",
              "org_id": "test-org",
              "project_id": "test-project",
              "rego": "",
              "updated": 1636669297674
            },
            "rego_error": "policy.rego:25: rego_parse_error: non-terminated string m == \"test",
            "status": "error"
          },
          {
            "deny_messages": [
              "deployment stage 'example-stage' does not have a HarnessApproval step",
              "deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"
            ],
            "output": "{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}",
            "policy": {
              "account_id": "eBqAoNchMLKigC_qZ5EdC",
              "created": 1636669297674,
              "identifier": "policy-1",
              "name": "Pipeline Approval",
              "org_id": "test-org",
              "project_id": "test-project",
              "rego": "",
              "updated": 1636669297674
            },
            "rego_error": "policy.rego:25: rego_parse_error: non-terminated string m == \"test",
            "status": "error"
          },
          {
            "deny_messages": [
              "deployment stage 'example-stage' does not have a HarnessApproval step",
              "deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"
            ],
            "output": "{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}",
            "policy": {
              "account_id": "eBqAoNchMLKigC_qZ5EdC",
              "created": 1636669297674,
              "identifier": "policy-1",
              "name": "Pipeline Approval",
              "org_id": "test-org",
              "project_id": "test-project",
              "rego": "",
              "updated": 1636669297674
            },
            "rego_error": "policy.rego:25: rego_parse_error: non-terminated string m == \"test",
            "status": "error"
          },
          {
            "deny_messages": [
              "deployment stage 'example-stage' does not have a HarnessApproval step",
              "deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"
            ],
            "output": "{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}",
            "policy": {
              "account_id": "eBqAoNchMLKigC_qZ5EdC",
              "created": 1636669297674,
              "identifier": "policy-1",
              "name": "Pipeline Approval",
              "org_id": "test-org",
              "project_id": "test-project",
              "rego": "",
              "updated": 1636669297674
            },
            "rego_error": "policy.rego:25: rego_parse_error: non-terminated string m == \"test",
            "status": "error"
          }
        ],
        "enabled": true,
        "identifier": "policyset-1",
        "name": "Production Policies",
        "org_id": "test-org",
        "project_id": "test-project",
        "status": "error",
        "type": "pipeline",
        "updated": 1636669297674
      },
      {
        "account_id": "eBqAoNchMLKigC_qZ5EdC",
        "action": "onrun",
        "created": 1636669297674,
        "description": "Captures critical production policies",
        "details": [
          {
            "deny_messages": [
              "deployment stage 'example-stage' does not have a HarnessApproval step",
              "deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"
            ],
            "output": "{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}",
            "policy": {
              "account_id": "eBqAoNchMLKigC_qZ5EdC",
              "created": 1636669297674,
              "identifier": "policy-1",
              "name": "Pipeline Approval",
              "org_id": "test-org",
              "project_id": "test-project",
              "rego": "",
              "updated": 1636669297674
            },
            "rego_error": "policy.rego:25: rego_parse_error: non-terminated string m == \"test",
            "status": "error"
          },
          {
            "deny_messages": [
              "deployment stage 'example-stage' does not have a HarnessApproval step",
              "deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"
            ],
            "output": "{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}",
            "policy": {
              "account_id": "eBqAoNchMLKigC_qZ5EdC",
              "created": 1636669297674,
              "identifier": "policy-1",
              "name": "Pipeline Approval",
              "org_id": "test-org",
              "project_id": "test-project",
              "rego": "",
              "updated": 1636669297674
            },
            "rego_error": "policy.rego:25: rego_parse_error: non-terminated string m == \"test",
            "status": "error"
          },
          {
            "deny_messages": [
              "deployment stage 'example-stage' does not have a HarnessApproval step",
              "deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"
            ],
            "output": "{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}",
            "policy": {
              "account_id": "eBqAoNchMLKigC_qZ5EdC",
              "created": 1636669297674,
              "identifier": "policy-1",
              "name": "Pipeline Approval",
              "org_id": "test-org",
              "project_id": "test-project",
              "rego": "",
              "updated": 1636669297674
            },
            "rego_error": "policy.rego:25: rego_parse_error: non-terminated string m == \"test",
            "status": "error"
          },
          {
            "deny_messages": [
              "deployment stage 'example-stage' does not have a HarnessApproval step",
              "deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"
            ],
            "output": "{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}",
            "policy": {
              "account_id": "eBqAoNchMLKigC_qZ5EdC",
              "created": 1636669297674,
              "identifier": "policy-1",
              "name": "Pipeline Approval",
              "org_id": "test-org",
              "project_id": "test-project",
              "rego": "",
              "updated": 1636669297674
            },
            "rego_error": "policy.rego:25: rego_parse_error: non-terminated string m == \"test",
            "status": "error"
          }
        ],
        "enabled": true,
        "identifier": "policyset-1",
        "name": "Production Policies",
        "org_id": "test-org",
        "project_id": "test-project",
        "status": "error",
        "type": "pipeline",
        "updated": 1636669297674
      },
      {
        "account_id": "eBqAoNchMLKigC_qZ5EdC",
        "action": "onrun",
        "created": 1636669297674,
        "description": "Captures critical production policies",
        "details": [
          {
            "deny_messages": [
              "deployment stage 'example-stage' does not have a HarnessApproval step",
              "deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"
            ],
            "output": "{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}",
            "policy": {
              "account_id": "eBqAoNchMLKigC_qZ5EdC",
              "created": 1636669297674,
              "identifier": "policy-1",
              "name": "Pipeline Approval",
              "org_id": "test-org",
              "project_id": "test-project",
              "rego": "",
              "updated": 1636669297674
            },
            "rego_error": "policy.rego:25: rego_parse_error: non-terminated string m == \"test",
            "status": "error"
          },
          {
            "deny_messages": [
              "deployment stage 'example-stage' does not have a HarnessApproval step",
              "deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"
            ],
            "output": "{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}",
            "policy": {
              "account_id": "eBqAoNchMLKigC_qZ5EdC",
              "created": 1636669297674,
              "identifier": "policy-1",
              "name": "Pipeline Approval",
              "org_id": "test-org",
              "project_id": "test-project",
              "rego": "",
              "updated": 1636669297674
            },
            "rego_error": "policy.rego:25: rego_parse_error: non-terminated string m == \"test",
            "status": "error"
          },
          {
            "deny_messages": [
              "deployment stage 'example-stage' does not have a HarnessApproval step",
              "deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"
            ],
            "output": "{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}",
            "policy": {
              "account_id": "eBqAoNchMLKigC_qZ5EdC",
              "created": 1636669297674,
              "identifier": "policy-1",
              "name": "Pipeline Approval",
              "org_id": "test-org",
              "project_id": "test-project",
              "rego": "",
              "updated": 1636669297674
            },
            "rego_error": "policy.rego:25: rego_parse_error: non-terminated string m == \"test",
            "status": "error"
          },
          {
            "deny_messages": [
              "deployment stage 'example-stage' does not have a HarnessApproval step",
              "deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"
            ],
            "output": "{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}",
            "policy": {
              "account_id": "eBqAoNchMLKigC_qZ5EdC",
              "created": 1636669297674,
              "identifier": "policy-1",
              "name": "Pipeline Approval",
              "org_id": "test-org",
              "project_id": "test-project",
              "rego": "",
              "updated": 1636669297674
            },
            "rego_error": "policy.rego:25: rego_parse_error: non-terminated string m == \"test",
            "status": "error"
          }
        ],
        "enabled": true,
        "identifier": "policyset-1",
        "name": "Production Policies",
        "org_id": "test-org",
        "project_id": "test-project",
        "status": "error",
        "type": "pipeline",
        "updated": 1636669297674
      }
    ],
    "entity": "7bbca5d4-e9f2-4955-9b2a-019ec4d3645e",
    "entity_metadata": "7bbca5d4-e9f2-4955-9b2a-019ec4d3645e",
    "id": 123,
    "input": "",
    "org_id": "test-org",
    "project_id": "test-project",
    "status": "error",
    "type": "pipeline,service"
  },
  "project": "kr",
  "repository": "my-repo",
  "repository_branch": "main",
  "repository_commit": "abc10ed",
  "repository_connector": "my-connector",
  "repository_path": "playbooks/",
  "tags": [
    "Perferendis quisquam quasi.",
    "Modi quis doloremque ex."
  ],
  "updated": 1627686800,
  "vars": "Esse quod consequatur eos voluptate beatae."
}

Last updated

Was this helpful?