mac-dev-playbook/tasks/extra-packages.yml

35 lines
1.3 KiB
YAML
Raw Normal View History

---
2021-04-12 15:44:54 +00:00
- 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) }}"
loop: "{{ composer_packages }}"
2021-04-11 18:16:05 +00:00
2021-04-12 15:44:54 +00:00
- name: Install global NPM packages.
npm:
name: "{{ item.name | default(item) }}"
state: "{{ item.state | default('present') }}"
version: "{{ item.version | default(omit) }}"
global: true
executable: "{{ item.executable | default(omit) }}"
loop: "{{ npm_packages }}"
2021-04-11 18:16:05 +00:00
2021-04-12 15:44:54 +00:00
- name: Install global Pip packages.
pip:
name: "{{ item.name | default(item) }}"
state: "{{ item.state | default('present') }}"
version: "{{ item.version | default(omit) }}"
executable: "{{ item.executable | default(omit) }}"
loop: "{{ pip_packages }}"
2021-04-11 18:16:05 +00:00
2021-04-12 15:44:54 +00:00
- name: Install global Ruby gems.
gem:
name: "{{ item.name | default(item) }}"
state: "{{ item.state | default('present') }}"
version: "{{ item.version | default(omit) }}"
user_install: false
executable: "{{ item.executable | default(omit) }}"
loop: "{{ gem_packages }}"