summaryrefslogtreecommitdiff
path: root/salt/openbook/ansible/files/gradle.yaml
blob: 4e7dc6a268ea38e033f6bab774439e97fdf4ab00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
- name: "Install gradle"
  hosts: target
  tasks:
    - name: "Add gradle PPA"
      apt_repository:
        repo: ppa:cwchien/gradle
        state: present
      when: ansible_distribution == "Ubuntu"

    - name: "Add nodejs PPA"
      shell: curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
      when: ansible_distribution == "Ubuntu"

    - name: "Update apt"
      apt:
        update_cache: yes
      when: ansible_distribution == "Ubuntu"

    - name: "Install packages"
      apt:
        pkg: "{{ item }}"
        state: present
      with_items:
        - gradle
        - nodejs
      when: ansible_distribution == "Ubuntu"

    - name: "Update yum cache"
      yum:
        update_cache: yes
      when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS"

    - name: "Install packages"
      yum:
        name: "{{ item }}"
        state: present
      with_items:
        - gradle
        - nodejs
      when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS"

    - name: "Install packages"
      portage:
        name: "{{ item }}"
        state: present
      with_items:
        - dev-java/gradle-bin
        - net-libs/nodejs
      when: ansible_distribution == "Gentoo"

    - name: "Forcibly upgrade npm"
      shell: npm install npm@latest -g