Skip to content

Instantly share code, notes, and snippets.

View alebsys's full-sized avatar

Aleksandr Lebedev alebsys

View GitHub Profile
- name: 'Load data into database'
shell: psql -f {{item}} application && touch {{item}}.lock
args:
chdir: /var/lib/postgresql
creates: "{{item}}.lock"
become: true
become_user: postgres
loop:
- petstore-schema.sql
tasks: # <-- Добавим задачи в наш сценарий
- name: 'Copy database schema file' # <-- См. Gist 1
copy:
src: ../files/petstore-schema.sql
dest: /var/lib/postgresql/petstore-schema.sql
owner: postgres
group: postgres
mode: 0600
- name: 'Copy database data file' # <-- См. Gist 2
copy:
- hosts: web
become: true
roles:
- ansible-role-universal-tomcat
tomcat_version: "7.0.76"
tomcat_port_connector: 8080
- src: https://github.com/Stouts/Stouts.iptables.git
version: 1.1.4
- src: geerlingguy.postgresql
- src: git+https://github.com/ChristopherDavenport/ansible-role-universal-tomcat
version: f0fe23a3b1541cbc60cabe69afe401f3df07d5d3
postgresql_version: 9.5
postgresql_users:
- name: appuser
pass: password
encrypted: yes
postgresql_databases:
- name: application
owner: appuser
- hosts: web
become: true
roles:
- Stouts.iptables
test:
hosts:
myhost:
ansible_host: xx.xx.xx.xx
ansible_user: ubuntu
fake:
hosts:
fake_host:
ansible_host: xx.xx.xx.xx
ansible_user: ubuntu
- name: clone repo
git:
repo: <repo_url> # адрес репозитория
dest: /opt/reddit
version: microservices_for_mc
---
- name: install bundler
apt:
name: bundler
state: present
update_cache: true
- name: install ui/comment dependencies
bundler:
state: present