ripclawffb.helix_core.helix_core_client module – Manage client/workspace on Perforce Helix Core

Note

This module is part of the ripclawffb.helix_core collection (version 1.3.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install ripclawffb.helix_core. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: ripclawffb.helix_core.helix_core_client.

New in ripclawffb.helix_core 1.0.0

Synopsis

  • A client/workspace specification defines the portion of the depot that can be accessed from that workspace and specifies where local copies of files in the depot are stored.

  • This module supports check mode.

Requirements

The below requirements are needed on the host that executes this module.

  • P4Python pip module is required

Parameters

Parameter

Comments

altroots

list / elements=string

Up to two optional alternate client workspace roots

Default: ["None"]

charset

aliases: p4charset

string

Character set used for translation of unicode files

Can also use ‘P4CHARSET’ environment variable

Default: "none"

description

string

A textual description of the workspace

Default: "Created by user."

host

string

The name of the workstation on which this workspace resides

Default: "hostname"

lineend

string

Configure carriage-return/linefeed (CR/LF) conversion

Choices:

  • "local" ← (default)

  • "unix"

  • "mac"

  • "win"

  • "share"

name

string / required

The name of the client that needs to be managed

options

string

A set of switches that control particular workspace options

Default: "noallwrite noclobber nocompress unlocked nomodtime normdir"

password

aliases: p4passwd

string / required

The login password

Can also use ‘P4PASSWD’ environment variable

root

string / required

The directory (on the local host) relative to which all the files in the View are specified

server

aliases: p4port

string / required

The hostname/ip and port of the server (perforce:1666)

Can also use ‘P4PORT’ environment variable

state

string

Determines if the client is present or deleted

Choices:

  • "present" ← (default)

  • "absent"

submitoptions

string

Options to govern the default behavior of p4 submit

Default: "submitunchanged"

user

aliases: p4user

string / required

A user with access to perform this operation

Can also use ‘P4USER’ environment variable

view

list / elements=string / required

Specifies the mappings between files in the depot and files in the workspace

See Also

See also

Helix Core Client

Create or edit a client workspace specification and its view

P4Python Pip Module

Python module to interact with Helix Core

Examples

# Create a client
- name: Create a new client
  helix_core_client:
    state: present
    name: bruno_new_client
    description: 'New client for Bruno'
    host: workstation01
    root: /tmp/bruno_new_client
    view:
      - //depot/... //bruno_new_client/depot/...
    server: '1666'
    user: bruno
    charset: none
    password: ''

# Delete a client
- name: Delete a client
  helix_core_client:
    state: absent
    name: bruno_new_client
    server: '1666'
    user: bruno
    charset: none
    password: ''

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

action

string

The action performed on the resource.

Returned: always

Can only return:

  • "created"

  • "updated"

  • "deleted"

  • "unchanged"

Sample: "created"

changed

boolean

Whether any changes were made to the client workspace.

Returned: always

Sample: true

changes

list / elements=dictionary

List of fields that were changed.

Returned: always

Sample: [{"after": "New description", "before": "Old description", "field": "Description"}]

client_spec

dictionary

The client workspace specification after the operation.

Returned: always

Sample: {"Client": "my_client", "Description": "My workspace", "Root": "/tmp/my_client"}

diff

dictionary

A dictionary containing ‘before’ and ‘after’ state of the resource.

Returned: when diff mode is enabled

after

string

The state of the resource after the action.

Returned: success

before

string

The state of the resource before the action.

Returned: success

Authors

  • Asif Shaikh (@ripclawffb)