Merge branch 'fix/npm' into 'master'

Fix/npm

See merge request tiutriumov.sm/ansible!2
This commit was merged in pull request #2.
This commit is contained in:
2024-04-22 19:29:56 +00:00
3 changed files with 24 additions and 23 deletions
+1 -8
View File
@@ -1,13 +1,6 @@
--- ---
- name: Update packages - name: Update packages
hosts: node hosts: node
become: yes become: true
roles: roles:
- role: ./tsm_labs - role: ./tsm_labs
+1 -1
View File
@@ -9,7 +9,7 @@ sudo: false
addons: addons:
apt: apt:
packages: packages:
- python-pip - python-pip
install: install:
# Install ansible # Install ansible
+21 -13
View File
@@ -19,6 +19,13 @@
state: present state: present
update_cache: true update_cache: true
- name: Install EPEL repo
when: ansible_os_family == 'RedHat'
ansible.builtin.yum:
name:
- epel-release
state: present
- name: Install nginx 'RedHat' - name: Install nginx 'RedHat'
when: ansible_os_family == 'RedHat' when: ansible_os_family == 'RedHat'
ansible.builtin.yum: ansible.builtin.yum:
@@ -37,29 +44,30 @@
- name: Install NodeJS-18 - name: Install NodeJS-18
when: "'node1' in inventory_hostname" when: "'node1' in inventory_hostname"
become: yes become: true
block: block:
- name: Скачивание ключа - name: Скачивание ключа
get_url: ansible.builtin.get_url:
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
dest: /tmp/nodesource.gpg.key dest: /tmp/nodesource.gpg.key
- name: Добавление открытого ключа от репозитория Node.js - name: Добавление открытого ключа от репозитория Node.js
apt_key: ansible.builtin.apt_key:
file: /tmp/nodesource.gpg.key file: /tmp/nodesource.gpg.key
- name: Добавление репозитория Node.js - name: Добавление репозитория Node.js
apt_repository: ansible.builtin.apt_repository:
repo: "deb https://deb.nodesource.com/node_18.x {{ ansible_distribution_release }} main" repo: deb https://deb.nodesource.com/node_18.x {{ ansible_distribution_release }} main
state: present state: present
update_cache: yes update_cache: true
- name: Установка Node.js - name: Установка Node.js
ansible.builtin.apt: ansible.builtin.apt:
package: package:
- nodejs - nodejs
- name: Копирование проекта
ansible.builtin.git:
repo: https://gitlab.resds.ru/itt/sample-project.git
dest: /src/sample-project
- name: Установка пакетов - name: Установка пакетов
npm: community.general.npm:
path: /home/cloudadmin/ansible_openstack/sample-project/notes-app/ path: /src/sample-project/notes-app/
global: no state: present
state: present