diff --git a/playbook.yaml b/playbook.yaml index d1c176f..be93689 100644 --- a/playbook.yaml +++ b/playbook.yaml @@ -1,13 +1,6 @@ --- - name: Update packages hosts: node - become: yes + become: true roles: - role: ./tsm_labs - - - - - - - diff --git a/tsm_labs/.travis.yml b/tsm_labs/.travis.yml index 36bbf62..121cc49 100644 --- a/tsm_labs/.travis.yml +++ b/tsm_labs/.travis.yml @@ -9,7 +9,7 @@ sudo: false addons: apt: packages: - - python-pip + - python-pip install: # Install ansible @@ -26,4 +26,4 @@ script: - ansible-playbook tests/test.yml -i tests/inventory --syntax-check notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file + webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/tsm_labs/tasks/main.yml b/tsm_labs/tasks/main.yml index 287697c..1ac2a26 100644 --- a/tsm_labs/tasks/main.yml +++ b/tsm_labs/tasks/main.yml @@ -19,6 +19,13 @@ state: present update_cache: true +- name: Install EPEL repo + when: ansible_os_family == 'RedHat' + ansible.builtin.yum: + name: + - epel-release + state: present + - name: Install nginx 'RedHat' when: ansible_os_family == 'RedHat' ansible.builtin.yum: @@ -37,29 +44,30 @@ - name: Install NodeJS-18 when: "'node1' in inventory_hostname" - become: yes + become: true block: - name: Скачивание ключа - get_url: + ansible.builtin.get_url: url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key dest: /tmp/nodesource.gpg.key - name: Добавление открытого ключа от репозитория Node.js - apt_key: + ansible.builtin.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" + ansible.builtin.apt_repository: + repo: deb https://deb.nodesource.com/node_18.x {{ ansible_distribution_release }} main state: present - update_cache: yes + update_cache: true - name: Установка Node.js ansible.builtin.apt: package: - nodejs - - name: Установка пакетов - npm: - path: /home/cloudadmin/ansible_openstack/sample-project/notes-app/ - global: no - state: present - - + - name: Копирование проекта + ansible.builtin.git: + repo: https://gitlab.resds.ru/itt/sample-project.git + dest: /src/sample-project + - name: Установка пакетов + community.general.npm: + path: /src/sample-project/notes-app/ + state: present