From 68be4d521d6960f6c5ccb8772e793cdd467ec94f Mon Sep 17 00:00:00 2001 From: Oliver Davies <oliver@oliverdavies.uk> Date: Thu, 7 Apr 2022 12:08:00 +0100 Subject: [PATCH] feat(platform-cli): add Platform.sh CLI Fixes: #27 --- main.yaml | 1 + roles/platformsh-cli/tasks/main.yaml | 30 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 roles/platformsh-cli/tasks/main.yaml diff --git a/main.yaml b/main.yaml index a6451ed2..51ab4095 100644 --- a/main.yaml +++ b/main.yaml @@ -16,6 +16,7 @@ - role: neovim - role: neovim-lsp - role: npm + - role: platformsh-cli - role: pv - role: ripgrep - role: starship-prompt diff --git a/roles/platformsh-cli/tasks/main.yaml b/roles/platformsh-cli/tasks/main.yaml new file mode 100644 index 00000000..6973fda5 --- /dev/null +++ b/roles/platformsh-cli/tasks/main.yaml @@ -0,0 +1,30 @@ +--- +- name: Install dependencies + ansible.builtin.package: + name: + - php + state: latest + become: true + +- name: Existing install + stat: + path: "{{ ansible_user_dir }}/.platformsh/bin/platform" + register: install + +- name: Download installer + ansible.builtin.get_url: + dest: /tmp/platformsh-install.sh + mode: 0755 + url: https://platform.sh/cli/installer + become: true + when: not install.stat.exists + +- name: Execute installer + ansible.builtin.command: php /tmp/platformsh-install.sh + when: not install.stat.exists + +- name: Remove platformsh-install.sh + ansible.builtin.file: + path: /tmp/platformsh-install.sh + state: absent + become: true