Skip to content
Snippets Groups Projects
Commit 8facd7c9 authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-playbooks/general#85 Linting

parent fcf9bb71
No related branches found
No related tags found
No related merge requests found
---
# file: roles/nodejs/handlers/main.yml
- name: "nodeJS | Include forever apps to Boot-List"
- name: nodeJS | Include forever apps to Boot-List
command: update-rc.d {{ item.service }} defaults
with_items: '{{ nodejs_forever_apps }}'
---
# file: roles/nodejs/tasks/main.yml
- name: "NodeJS Role"
set_fact: role_nodejs_started=true
tags: 'always'
- name: NodeJS Role
set_fact:
role_nodejs_started: yes
tags:
- always
- block:
- name: "nodeJS | Install required packages"
- name: nodeJS | Install required packages
apt:
pkg={{ packages }}
state=present
......@@ -17,18 +19,18 @@
- python-software-properties
when: ansible_distribution_release != 'bionic'
- name: "nodeJS | Add key"
- name: nodeJS | Add key
apt_key:
url="https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
state=present
- name: "nodeJS | Add repository"
- name: nodeJS | Add repository
apt_repository:
repo="deb https://deb.nodesource.com/node_8.x {{ ansible_distribution_release }} main"
state=present
mode='644'
- name: "nodeJS | Install core packages"
- name: nodeJS | Install core packages
apt:
pkg={{ packages }}
state=present
......@@ -37,7 +39,7 @@
packages:
- nodejs
- name: "nodeJS | Install npm packages"
- name: nodeJS | Install npm packages
npm:
name={{ item }}
state=present
......@@ -52,7 +54,7 @@
- bower
- npm-check-updates
- name: "nodeJS | Ensure log directory"
- name: nodeJS | Ensure log directory
file:
dest=/var/log/nodejs
owner=root
......@@ -60,7 +62,7 @@
state=directory
mode='775'
- name: "nodeJS | Ensure apps directory"
- name: nodeJS | Ensure apps directory
file:
dest="{{ item.target }}"
owner=root
......@@ -69,7 +71,7 @@
mode='775'
with_items: '{{ nodejs_apps }}'
- name: "nodeJS | Install apps"
- name: nodeJS | Install apps
git:
accept_hostkey: "yes"
repo: "{{ item.repository }}"
......@@ -79,7 +81,7 @@
become: false
with_items: '{{ nodejs_apps }}'
- name: "nodeJS | Install apps config files"
- name: nodeJS | Install apps config files
copy:
src="{{ item.config.src }}"
dest="{{ item.config.target }}"
......@@ -88,12 +90,12 @@
mode='644'
with_items: '{{ nodejs_apps }}'
- name: "nodeJS | Install apps packages"
- name: nodeJS | Install apps packages
npm:
path="{{ item.target }}"
with_items: '{{ nodejs_apps }}'
- name: "nodeJS | Install forever apps"
- name: nodeJS | Install forever apps
template:
src=initd.sh
dest=/etc/init.d/{{ item.service }}
......@@ -104,13 +106,14 @@
notify:
- "nodeJS | Include forever apps to Boot-List"
- name: "nodeJS | Enable logrotate"
- name: nodeJS | Enable logrotate
template:
src=etc_logrotate_d_nodejs
dest=/etc/logrotate.d/nodejs
owner=root
group=root
mode='644'
tags: 'logrotate'
tags:
- logrotate
when: '"nodejs" not in excluded_roles'
when: not excluded_roles or "nodejs" not in excluded_roles
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment