Installs the platform.sh CLI, on any Linux or UNIX system.
php
(version 5.5+) should be installed and working.git
should be installed and working.
Available variables are listed below, along with default values (see defaults/main.yml
):
platformsh_path: /usr/local/bin/platform
The path where platform.sh CLI will be installed and available to your system. Should be in your user's $PATH
so you can run commands simply with platform
instead of the full path.
platformsh_keep_updated: false
Set this to true
to update the platform.sh CLI to the latest release every time the playbook is run.
php_executable: php
The executable name or full path to the PHP executable. This is defaulted to php
if you don't override the variable.
platformsh_shell_config_path: ''
Since the platform.sh CLI shell config contains bash autocompletion it can't be put into /etc/profile.d
and thus you must define a path, where to put the file to load it globally. For example on Ubuntu/Debian you can use /etc/bash.bashrc.d
and add the following snippet to /etc/bash.bashrc
:
if [ -d /etc/bash.bashrc.d ]; then
for i in /etc/bash.bashrc.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
None (but make sure you've installed PHP).
- hosts: phpdevs
roles:
- pixelart.platformsh-cli
After the playbook runs, platform
will be placed in /usr/local/bin/platform
(this location is configurable), and will be accessible via normal user accounts.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
MIT, see the LICENSE file.
This role was created in 2017 by pixelart GmbH and inspired by the roles of Jeff Geerling, author of Ansible for DevOps.