mirror of
https://github.com/geerlingguy/mac-dev-playbook
synced 2024-11-28 23:00:19 +00:00
32 lines
1.1 KiB
YAML
32 lines
1.1 KiB
YAML
|
---
|
||
|
- name: Install global Composer packages.
|
||
|
composer:
|
||
|
command: "{{ (item.state | default('present') == 'absent') | ternary('remove', 'require') }}"
|
||
|
arguments: "{{ item.name | default(item) }} {{ item.version | default('@stable') }}"
|
||
|
# Ansible 2.4 supports `global_command` making `working_dir` optional.
|
||
|
working_dir: "{{ lookup('env', 'COMPOSER_HOME') | default('~/.composer', true) }}"
|
||
|
with_items: "{{ composer_packages }}"
|
||
|
|
||
|
- name: Install global NPM packages.
|
||
|
npm:
|
||
|
name: "{{ item.name | default(item) }}"
|
||
|
version: "{{ item.version | default('latest') }}"
|
||
|
state: "{{ item.state | default('present') }}"
|
||
|
global: yes
|
||
|
with_items: "{{ npm_packages }}"
|
||
|
|
||
|
- name: Install global Pip packages.
|
||
|
pip:
|
||
|
name: "{{ item.name | default(item) }}"
|
||
|
version: "{{ item.version | default(omit) }}"
|
||
|
state: "{{ item.state | default('latest') }}"
|
||
|
with_items: "{{ pip_packages }}"
|
||
|
|
||
|
- name: Install global Ruby gems.
|
||
|
gem:
|
||
|
name: "{{ item.name | default(item) }}"
|
||
|
version: "{{ item.version | default(omit) }}"
|
||
|
state: "{{ item.state | default('latest') }}"
|
||
|
user_install: false
|
||
|
with_items: "{{ gem_packages }}"
|