On Github dariusgm / ansible-meetup
.
├── handlers
│ └── main.yml
├── library
│ └── users
├── roles
│ ├── appdirs
│ ├── common
│ ├── elasticsearch
│ ├── kibana
│ ├── lock
│ ├── logstash
│ ├── mailcatcher
│ ├── monit
│ ├── nginx
│ ├── nodejs
│ ├── phantomjs
│ ├── postgresql
│ ├── public-keys
│ ├── rabbitmq
│ ├── rbenv
│ ├── redis
│ ├── (roles for our apps)
├── stages
│ ├── sandbox
│ └── vagrant
├── README.md
├── Vagrantfile
├── (many plays for our apps)
└── ansible.cfg
├── handlers
│ └── main.yml
├── tasks
│ ├── main.yml
│ ├── sandbox.yml
│ └── vagrant.yml
└── templates
├── etc
│ ├── monit
│ │ └── conf.d
│ │ └── wlw_serp
│ └── nginx
│ ├── assets_locations
│ │ └── wlw_serp_assets.conf
│ ├── locations
│ │ └── wlw_serp.conf
│ └── upstreams
│ └── wlw_serp.conf
├── home
│ └── appsse
│ └── wlw_serp
│ └── shared
│ └── bin
│ └── _unicorn
├── sandbox
│ └── home
│ └── appsse
│ └── wlw_serp
│ └── shared
│ └── config
│ └── unicorn.rb
└── vagrant
└── home
└── appsse
└── wlw_serp
└── shared
├── database.yml
└── unicorn.rb
>
- hosts: app
sudo: yes
roles:
- common
- monit
- nginx
- appsse
- rbenv
- { role: appdirs, app: wlw_serp }
- wlw_serp
handlers:
- include: handlers/main.yml
---
- include: sandbox.yml
when: inventory_hostname_short != "sandbox-dev"
- include: vagrant.yml
when: inventory_hostname_short == "sandbox-dev"
- name: configure nginx
template:
src={{ item }}
dest=/{{ item }}
with_items:
- etc/nginx/locations/wlw_serp.conf
- etc/nginx/upstreams/wlw_serp.conf
notify:
- restart nginx
- name: copy bin/unicorn
template:
src="home/appsse/wlw_serp/shared/bin/_unicorn"
dest="{{ users.appsse.home }}/wlw_serp/shared/bin/_unicorn"
mode=0755
sudo: yes
sudo_user: appsse
- name: configure monit
template:
src=etc/monit/conf.d/wlw_serp
dest=/etc/monit/conf.d/wlw_serp
notify: restart monit
---
- name: gather public keys to be installed for root
local_action: shell cat roles/public-keys/files/keys/root/*.pub roles/public-keys/files/jenkins.pub
changed_when: False
sudo: False
ignore_errors: yes
register: keys_dev
- name: create .ssh directory for root
file:
path="{{ users.root.home }}/.ssh"
state=directory
owner=root
group="{{ users.root.group }}"
mode=0700
- name: install authorized_keys for root
copy:
content="{{ keys_dev.stdout }}"
dest="{{ users.root.home }}/.ssh/authorized_keys"
owner=appsse
group="{{ users.root.group }}"
mode=0600