This repository has been archived on 2024-10-22. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
npm/tasks/main.yml
2020-11-07 21:47:38 +01:00

58 lines
1.5 KiB
YAML

- name: load OS specific vars
include_vars: "{{ item }}"
with_first_found:
- files:
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}.yml"
- "{{ ansible_distribution|lower }}.yml"
- "{{ ansible_os_family|lower }}.yml"
paths:
- "{{ role_path }}/vars"
- name: update apt cache
become: true
apt:
update_cache: yes
when: ansible_facts['os_family'] == "Debian" or ansible_facts['os_family'] == "Ubuntu"
- name: update pacman cache
become: true
pacman:
update_cache: yes
when: ansible_facts['os_family'] == "Archlinux"
- name: install needed tools
become: yes
package:
name: "{{ item }}"
state: present
loop: "{{ pre_packages }}"
- name: add nodesource apt key
become: yes
apt_key:
url: "{{ node_gpg_key }}"
state: present
when: ansible_facts['os_family'] == "Debian" or ansible_facts['os_family'] == "Ubuntu"
- name: add nodesource source
become: yes
template:
src: "nodesource.list.j2"
dest: "/etc/apt/sources.list.d/nodesource.list"
mode: "0600"
when: ansible_facts['os_family'] == "Debian" or ansible_facts['os_family'] == "Ubuntu"
- name: create apt pinning file
become: yes
template:
src: "nodesource.j2"
dest: "/etc/apt/preferences.d/nodesource"
mode: "0644"
when: ansible_facts['os_family'] == "Debian" or ansible_facts['os_family'] == "Ubuntu"
- name: install front-end packages
become: yes
package:
name: "{{ item }}"
state: present
loop: "{{ packages }}"