66 lines
1.6 KiB
YAML
66 lines
1.6 KiB
YAML
---
|
|
- name: Update all packages Ubuntu
|
|
when: ansible_os_family == 'Debian'
|
|
ansible.builtin.apt:
|
|
update_cache: true
|
|
upgrade: true
|
|
|
|
- name: Update all packages CentOS
|
|
when: ansible_os_family == 'RedHat'
|
|
ansible.builtin.yum:
|
|
name: "*"
|
|
state: latest
|
|
|
|
- name: Install nginx 'Ubuntu'
|
|
when: ansible_os_family == 'Debian'
|
|
ansible.builtin.apt:
|
|
package:
|
|
- nginx
|
|
state: present
|
|
update_cache: true
|
|
|
|
- name: Install nginx 'RedHat'
|
|
when: ansible_os_family == 'RedHat'
|
|
ansible.builtin.yum:
|
|
name:
|
|
- nginx
|
|
state: present
|
|
|
|
- name: Copy config nginx
|
|
ansible.builtin.template:
|
|
src: nginx.conf.j2
|
|
dest: /etc/nginx/nginx.conf
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
notify: Reload nginx service
|
|
|
|
- name: Install NodeJS-18
|
|
when: "'node1' in inventory_hostname"
|
|
become: yes
|
|
block:
|
|
- name: Скачивание ключа
|
|
get_url:
|
|
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
|
|
dest: /tmp/nodesource.gpg.key
|
|
- name: Добавление открытого ключа от репозитория Node.js
|
|
apt_key:
|
|
file: /tmp/nodesource.gpg.key
|
|
- name: Добавление репозитория Node.js
|
|
apt_repository:
|
|
repo: "deb https://deb.nodesource.com/node_18.x {{ ansible_distribution_release }} main"
|
|
state: present
|
|
update_cache: yes
|
|
- name: Установка Node.js
|
|
ansible.builtin.apt:
|
|
package:
|
|
- nodejs
|
|
- name: Установка пакетов
|
|
npm:
|
|
path: /home/cloudadmin/ansible_openstack/sample-project/notes-app/
|
|
global: no
|
|
state: present
|
|
|
|
|
|
|