[ansible] added deploy role
This commit is contained in:
10
ansible/roles/setup/tasks/apt.yml
Normal file
10
ansible/roles/setup/tasks/apt.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
- name: Install the package "Neko"
|
||||
apt:
|
||||
name: 'neko'
|
||||
|
||||
- name: Install the package "Node"
|
||||
apt:
|
||||
name: '{{ item }}'
|
||||
with_items:
|
||||
- nodejs
|
||||
- npm
|
||||
6
ansible/roles/setup/tasks/main.yml
Normal file
6
ansible/roles/setup/tasks/main.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
- import_tasks: apt.yml
|
||||
when: ansible_distribution|lower == 'ubuntu'
|
||||
|
||||
- import_tasks: npm.yml
|
||||
|
||||
- import_tasks: service.yml
|
||||
4
ansible/roles/setup/tasks/npm.yml
Normal file
4
ansible/roles/setup/tasks/npm.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
- name: Install "gulp-cli" node.js package globally.
|
||||
npm:
|
||||
name: gulp-cli
|
||||
global: yes
|
||||
10
ansible/roles/setup/tasks/service.yml
Normal file
10
ansible/roles/setup/tasks/service.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
- name: "install {{ service_name }} systemd unit file"
|
||||
template:
|
||||
src: "template/service.j2"
|
||||
dest: "/etc/systemd/system/{{ service_name }}.service"
|
||||
|
||||
- name: "start {{ service_name }} service"
|
||||
systemd:
|
||||
state: started
|
||||
name: "{{ service_name }}"
|
||||
daemon_reload: yes
|
||||
Reference in New Issue
Block a user