README.md #1

  • //
  • guest/
  • russell_jackson/
  • ansible-sdp/
  • roles/
  • perforce-sdp-install/
  • README.md
  • Markdown
  • View
  • Commits
  • Open Download .zip Download (5 KB)

Role Name

ansible-perforce_sdp_install-role

Role Function

Ansible role to install perforce-sdp framework

ALL SERVERS: main.yml

  • Sets up a perforce OS user/group
  • Installs any dependeny packages
  • Installs perforce SDP framework
  • Installs perforce license file
  • Executes the mkdirs.sh script
  • Sets up a perforce service

MASTER:

  • Sets up ssh keys from replicas if proper var is set
  • Sets up another network interface for perforce_dnsname if it's not equal to ansible_hostname

ALL SERVERS: update.yml

  • Updates perforce SDP framework
  • Updates the p4/p4d binary files
  • Updates the mkdirs.cfg file
  • Executes the mkdirs.sh script
  • Upgrades the database
  • restarts perforce service

Requirements

  • If perforce_dnsname is set, it has to have a valid IP
  • Only supports one master server
  • Inventory currently requires the following groups
    • p4dmaster (for master servers)
    • p4dreplica (for standby servers)

Usage

Most variables are optional and the default values can be used.<br> There is one important option that dictates the use of NFS for the depots directory.<br> perforce_depots_use_nfs<br>

  • When set to true:
    • perforce_shareddata: defaults to 'TRUE'
  • When set to false:
    • perforce_shareddata: defaults to 'FALSE'

Release notes: https://www.perforce.com/perforce/doc.current/user/relnotes.txt<br>

To Upgrade SDP Version

Grab the latest version of the SDP from https://swarm.workshop.perforce.com/downloads/guest/russell_jackson/sdp.tgz Put the SDP archive in the files folder of this role as sdp.tgz.

Role Variables

Name Description Default Value
perforce_sdp_file The perforce SDP archive file "sdp-{{ perforce_sdp_version }}.tgz"
perforce_depots_use_nfs Determines if an NFS mount will be used for the depots directory false
perforce_id ID used for perforce configuration "1"
perforce_service Perforce system service name "p4d_{{ perforce_id }}"
source_env The environment script sourced for running perforce commands "source /p4/common/bin/p4_vars"
perforce_user perforce os user "perforce"
perforce_uid perforce os user id "2000"
perforce_group perforce os group "perforce"
perforce_gid perforce os group id "2000"
perforce_dir Main directory for perforce "mnt/p4data"
perforce_online_metadata_volume Directory used for perforce db1 "{{ perforce_dir }}/db1"
perforce_offline_metadata_volume Directory used for perforce db2 "{{ perforce_dir }}/db2"
perforce_data_volume Directory used for perforce depots "{{ perforce_dir }}/depots"
perforce_log_volume Directory used for perforce logs and journals "{{ perforce_dir }}/logs"
perforce_version perforce version to download "21.2"
perforce_sdp Directory for sdp install "{{ perforce_dir }}/sdp"
perforce_sdp_setup_location Directory for sdp setup files "{{ perforce_sdp }}/Server/Unix/setup"
perforce_sdp_bin_location Directory for sdp bin files "{{ perforce_sdp }}/Server/Unix/p4/common/bin"
perforce_case_sensitive turn case insensitivity on with '0' or have it default to the OS platform "1"
perforce_common_volume perforce common volume location "$DD"
perforce_shareddata Perforce enable shared data "TRUE"
perforce_domain Domain used for mail "domain.com"
perforce_mailfrom_email Email address to use for sending "p4admin@{{ perforce_domain }}"
perforce_mailto_email Email address to send emails to "p4admins@{{ perforce_domain }}"
perforce_smtp_server smtp server for perforce to send emails through "smtp.{{ perforce_domain }}"
perforce_ssl_prefix Set this to use SSL ""
perforce_p4_port Port used for p4 service "1666"
perforce_p4broker_port port used for p4 broker service "1667"
perforce_dnsname DNS name of the perforce service "$(hostname)" (This is normally the DNS name of the master)
perforce_master_id Name used for master instance "master"
perforce_replica_id Name used for replica instance "standby"
perforce_server_type Var used in mkdirs.cfg file "p4d_master"
perforce_complainfrom_domain Var used in mkdirs.cfg "${DOMAIN}"
perforce_complainfrom Var used in mkdirs.cfg '${SSL_PREFIX}${P4DNSNAME}:${P4_PORT}_P4Review\@${COMPLAINFROM_DOMAIN}'
perforce_admin_user Admin user to setup "p4admin"
perforce_admin_user_pass Admin user password to setup "adm1nPass"

Example Usage

# Sample playbook and inventory files below
ansible-playbook -i <inventory-file> <playbook-file> --ask-pass

Example Playbook

example-playbook.yml:

- hosts: p4d_master, p4d_replica
  roles:
    - "ansible-perforce_sdp_install-role"

Example Inventory

example-inventory.yml

all:
  # Vars at Global level - Can also be defined at group/host level
  vars:
    perforce_depots_use_nfs: true
  children:
    p4d_master:
      hosts:
        usxxxl-perf001:
    p4d_replica:
      hosts:
        usxxxl-perf002:
Role Name
=========
ansible-perforce_sdp_install-role

Role Function
=========
Ansible role to install perforce-sdp framework

ALL SERVERS: main.yml
* Sets up a perforce OS user/group
* Installs any dependeny packages
* Installs perforce SDP framework
* Installs perforce license file
* Executes the mkdirs.sh script
* Sets up a perforce service

MASTER:
* Sets up ssh keys from replicas if proper var is set
* Sets up another network interface for perforce_dnsname if it's not equal to ansible_hostname

ALL SERVERS: update.yml
* Updates perforce SDP framework
* Updates the p4/p4d binary files
* Updates the mkdirs.cfg file
* Executes the mkdirs.sh script
* Upgrades the database
* restarts perforce service

Requirements
------------
* If perforce_dnsname is set, it has to have a valid IP
* Only supports one master server
* Inventory currently requires the following groups
  * p4dmaster (for master servers)
  * p4dreplica (for standby servers)

Usage
=========
Most variables are optional and the default values can be used.<br>
There is one important option that dictates the use of NFS for the depots directory.<br>
**perforce_depots_use_nfs**<br>
  * When set to true:
    * **perforce_shareddata**: defaults to 'TRUE'
  * When set to false:
    * **perforce_shareddata**: defaults to 'FALSE'

Release notes: https://www.perforce.com/perforce/doc.current/user/relnotes.txt<br>

To Upgrade SDP Version
=========
Grab the latest version of the SDP from https://swarm.workshop.perforce.com/downloads/guest/russell_jackson/sdp.tgz
Put the SDP archive in the files folder of this role as sdp.tgz.

Role Variables
--------------

| Name | Description | Default Value |
|:--------------------------------:|:-------------------------------------:|:----------------------------------------------|
| perforce_sdp_file | The perforce SDP archive file | "sdp-{{ perforce_sdp_version }}.tgz" |
| perforce_depots_use_nfs | Determines if an NFS mount will be used for the depots directory | false |
| perforce_id | ID used for perforce configuration | "1" |
| perforce_service | Perforce system service name | "p4d_{{ perforce_id }}" |
| source_env | The environment script sourced for running perforce commands | "source /p4/common/bin/p4_vars" |
| perforce_user | perforce os user | "perforce" |
| perforce_uid | perforce os user id | "2000" |
| perforce_group | perforce os group | "perforce" |
| perforce_gid | perforce os group id | "2000" |
| perforce_dir | Main directory for perforce | "mnt/p4data" |
| perforce_online_metadata_volume | Directory used for perforce db1 | "{{ perforce_dir }}/db1" |
| perforce_offline_metadata_volume | Directory used for perforce db2 | "{{ perforce_dir }}/db2" |
| perforce_data_volume | Directory used for perforce depots | "{{ perforce_dir }}/depots" |
| perforce_log_volume | Directory used for perforce logs and journals | "{{ perforce_dir }}/logs" |
| perforce_version | perforce version to download | "21.2" |
| perforce_sdp | Directory for sdp install | "{{ perforce_dir }}/sdp" |
| perforce_sdp_setup_location | Directory for sdp setup files | "{{ perforce_sdp }}/Server/Unix/setup" |
| perforce_sdp_bin_location | Directory for sdp bin files | "{{ perforce_sdp }}/Server/Unix/p4/common/bin" |
| perforce_case_sensitive | turn case insensitivity on with '0' or have it default to the OS platform  | "1" |
| perforce_common_volume | perforce common volume location | "$DD" |
| perforce_shareddata | Perforce enable shared data | "TRUE" |
| perforce_domain | Domain used for mail | "domain.com" |
| perforce_mailfrom_email | Email address to use for sending | "p4admin@{{ perforce_domain }}" |
| perforce_mailto_email | Email address to send emails to | "p4admins@{{ perforce_domain }}" |
| perforce_smtp_server | smtp server for perforce to send emails through| "smtp.{{ perforce_domain }}" |
| perforce_ssl_prefix | Set this to use SSL | "" |
| perforce_p4_port | Port used for p4 service | "1666" |
| perforce_p4broker_port | port used for p4 broker service | "1667" |
| perforce_dnsname | DNS name of the perforce service | "$(hostname)" (This is normally the DNS name of the master)
| perforce_master_id | Name used for master instance | "master"
| perforce_replica_id | Name used for replica instance | "standby"
| perforce_server_type | Var used in mkdirs.cfg file | "p4d_master" |
| perforce_complainfrom_domain | Var used in mkdirs.cfg | "${DOMAIN}" |
| perforce_complainfrom | Var used in mkdirs.cfg | '${SSL_PREFIX}${P4DNSNAME}:${P4_PORT}_P4Review\@${COMPLAINFROM_DOMAIN}' |
| perforce_admin_user | Admin user to setup | "p4admin" |
| perforce_admin_user_pass | Admin user password to setup | "adm1nPass" |

Example Usage
------------
```
# Sample playbook and inventory files below
ansible-playbook -i <inventory-file> <playbook-file> --ask-pass
```

Example Playbook
----------------
example-playbook.yml:
```
- hosts: p4d_master, p4d_replica
  roles:
    - "ansible-perforce_sdp_install-role"
```

Example Inventory
-----------------
example-inventory.yml
```
all:
  # Vars at Global level - Can also be defined at group/host level
  vars:
    perforce_depots_use_nfs: true
  children:
    p4d_master:
      hosts:
        usxxxl-perf001:
    p4d_replica:
      hosts:
        usxxxl-perf002:
```
# Change User Description Committed
#1 32488 Russell C. Jackson (Rusty) Ansible scaffolding for the sdp - Needs work.