pixelart.platformsh-cli
Ansible Role: platform.sh CLI
This role installs the platform.sh command-line tool on any Linux or UNIX system.
Requirements
- You need to have
php
(version 5.5 or newer) installed and working. - You also need to have
git
installed and working.
Role Variables
Here are the available variables and their default values (check defaults/main.yml
):
platformsh_path
: /usr/local/bin/platform
This sets the location where the platform.sh CLI will be installed. It should be in your user's$PATH
so you can simply useplatform
to run commands instead of the full path.platformsh_keep_updated
: false
Change this totrue
if you want to automatically update the platform.sh CLI to the latest version every time you run the playbook.php_executable
: php
This is the name or path of the PHP executable. By default, it is set tophp
unless you change it.platformsh_shell_config_path
: ''
Since the platform.sh CLI's shell configuration supports bash autocompletion, it can't go in/etc/profile.d
. You need to specify a path where to put the file for global loading. For Ubuntu/Debian users, you can use/etc/bash.bashrc.d
and add this 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
Dependencies
No dependencies (just make sure PHP is installed).
Example Playbook
- hosts: phpdevs
roles:
- pixelart.platformsh-cli
Once the playbook runs, the platform
tool will be installed in /usr/local/bin/platform
(you can change this location) and will be available for normal user accounts.
Code of Conduct
This project follows a Contributor Code of Conduct. By participating in this project, you agree to follow its rules.
License
This project is licensed under MIT. See the LICENSE file for details.
Author Information
This role was created in 2017 by pixelart GmbH and is inspired by the work of Jeff Geerling, author of Ansible for DevOps.
ansible-galaxy install pixelart.platformsh-cli