mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
WIP ansible
This commit is contained in:
17
Vagrantfile
vendored
17
Vagrantfile
vendored
@@ -20,11 +20,6 @@ def which(cmd)
|
||||
end
|
||||
|
||||
def config_net(config)
|
||||
# Configure hostmanager
|
||||
config.hostmanager.enabled = true
|
||||
config.hostmanager.manage_host = true
|
||||
config.hostmanager.ignore_private_ip = false
|
||||
config.hostmanager.include_offline = true
|
||||
config.hostmanager.aliases = [
|
||||
$hostname + ".vb",
|
||||
"www." + $hostname + ".vb",
|
||||
@@ -52,10 +47,18 @@ def config_net(config)
|
||||
end
|
||||
|
||||
# By default, the name of the VM is the project's directory name
|
||||
$hostname = File.basename($root)
|
||||
$hostname = File.basename($root).downcase
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
|
||||
# Configure hostmanager
|
||||
config.hostmanager.enabled = true
|
||||
config.hostmanager.manage_host = true
|
||||
config.hostmanager.ignore_private_ip = false
|
||||
config.hostmanager.include_offline = true
|
||||
|
||||
config.vm.hostname = $hostname
|
||||
|
||||
config.vm.provider :virtualbox do |v|
|
||||
v.name = $hostname
|
||||
v.customize [
|
||||
@@ -76,8 +79,8 @@ Vagrant.configure("2") do |config|
|
||||
if which('ansible-playbook')
|
||||
config.vm.provision "ansible" do |ansible|
|
||||
ansible.playbook = "resources/ansible/playbook.yml"
|
||||
#ansible.inventory_path = "ansible/inventories/dev"
|
||||
ansible.limit = 'all'
|
||||
ansible.verbose = 'v'
|
||||
ansible.extra_vars = {
|
||||
hostname: $hostname,
|
||||
postfix: {
|
||||
|
@@ -1,2 +0,0 @@
|
||||
[phansible-web]
|
||||
192.168.56.101
|
@@ -13,3 +13,4 @@
|
||||
- xdebug
|
||||
- composer
|
||||
- app
|
||||
- mailcatcher
|
||||
|
2
resources/ansible/roles/mailcatcher/defaults/main.yml
Normal file
2
resources/ansible/roles/mailcatcher/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
mailcatcher_gem: mailcatcher
|
0
resources/ansible/roles/mailcatcher/tasks/main.yml
Normal file
0
resources/ansible/roles/mailcatcher/tasks/main.yml
Normal file
@@ -5,7 +5,8 @@
|
||||
|
||||
- name: Add MariaDB-Repository
|
||||
sudo: yes
|
||||
apt_repository: repo='deb http://mirror3.layerjet.com/mariadb/repo/10.1/ubuntu {{ ansible_distribution_release }} main' state=present
|
||||
apt_repository: repo='deb http://mirror6.layerjet.com/mariadb/repo/10.1/ubuntu {{ ansible_distribution_release }} main' state=present
|
||||
register: mariadb_repository
|
||||
|
||||
- name: Add Key for MariaDB Repository
|
||||
sudo: yes
|
||||
@@ -14,6 +15,7 @@
|
||||
- name: Update apt
|
||||
sudo: yes
|
||||
apt: update_cache=yes
|
||||
when: mariadb_repository.changed
|
||||
|
||||
- name: mariadb | Install MariaDB Packages
|
||||
sudo: yes
|
||||
|
@@ -5,5 +5,5 @@
|
||||
|
||||
- name: Change default nginx site
|
||||
sudo: yes
|
||||
template: src=default.tpl dest=/etc/nginx/sites-available/default
|
||||
template: src=default.j2 dest=/etc/nginx/sites-available/default
|
||||
notify: restart nginx
|
||||
|
@@ -4,7 +4,7 @@ server {
|
||||
root {{ nginx.docroot }};
|
||||
index index.html index.php;
|
||||
|
||||
server_name {{ nginx.servername }};
|
||||
server_name {{ nginx|to_yaml }};
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
@@ -1,2 +1,2 @@
|
||||
; Configuration for php PECL {{ item }} extension
|
||||
extension={{ item }}.so
|
||||
; Configuration for php PECL {{ item.name }} extension
|
||||
extension={{ item.name }}.so
|
||||
|
@@ -2,6 +2,7 @@
|
||||
- name: Update apt
|
||||
sudo: yes
|
||||
apt: update_cache=yes
|
||||
when: server.prevent_update is defined
|
||||
|
||||
- name: Install System Packages
|
||||
sudo: yes
|
||||
@@ -19,13 +20,13 @@
|
||||
|
||||
- name: Configure the timezone
|
||||
sudo: yes
|
||||
template: src=timezone.tpl dest=/etc/timezone
|
||||
template: src=timezone.j2 dest=/etc/timezone
|
||||
|
||||
- name: More Configure the timezone
|
||||
sudo: yes
|
||||
file: src=/usr/share/zoneinfo/{{server.timezone}} dest=/etc/localtime state=link force=yes backup=yes
|
||||
|
||||
- name: Set default system language pack
|
||||
shell: locale-gen {{server.locale}}
|
||||
shell: locale-gen {{server.locales|join(' ')}}
|
||||
sudo: yes
|
||||
|
||||
|
@@ -8,4 +8,5 @@
|
||||
when: vagrant_local.vm.hostname is defined
|
||||
|
||||
- name: Update /etc/hosts
|
||||
lineinfile: dest=/etc/hosts regexp='^127\.0\.0\.1' line='127.0.0.1 localhost {{ vagrant_local.vm.hostname }}' owner=root group=root mode=0644
|
||||
lineinfile: dest=/etc/hosts regexp='^127\.0\.0\.1' line='127.0.0.1 localhost {{ vagrant_local.vm.hostname|default('') }}' owner=root group=root mode=0644
|
||||
when: vagrant_local.vm.hostname is defined
|
||||
|
@@ -1,16 +1,34 @@
|
||||
---
|
||||
server:
|
||||
install: '1'
|
||||
packages: [vim, git, imagemagick, htop, nodejs, npm, iotop, pkg-config, libzmq3-dev]
|
||||
packages:
|
||||
- vim
|
||||
- git
|
||||
- imagemagick
|
||||
- htop
|
||||
- nodejs
|
||||
- npm
|
||||
- iotop
|
||||
- pkg-config
|
||||
- libzmq3-dev
|
||||
- supervisor
|
||||
timezone: UTC
|
||||
locale: fr_FR.UTF-8
|
||||
locales:
|
||||
- en_GB.UTF-8
|
||||
- fr_FR.UTF-8
|
||||
- de_DE.UTF-8
|
||||
- nl_NL.UTF-8
|
||||
vagrant_local:
|
||||
install: '1'
|
||||
vm: { base_box: trusty64, hostname: phraseanet.dev, ip: 192.168.56.101, memory: '4096', sharedfolder: ./, useVagrantCloud: '1', syncType: nfs }
|
||||
vm:
|
||||
base_box: trusty64
|
||||
memory: '4096'
|
||||
sharedfolder: ./
|
||||
useVagrantCloud: '1'
|
||||
syncType: nfs
|
||||
nginx:
|
||||
install: '1'
|
||||
docroot: /vagrant
|
||||
servername: master.phraseanet.vb
|
||||
mariadb:
|
||||
install: '1'
|
||||
root_password: toor
|
||||
@@ -21,7 +39,7 @@ mariadb:
|
||||
elasticsearch:
|
||||
install: '1'
|
||||
port: '9200'
|
||||
version: 1.5.2
|
||||
version: '1.7.3'
|
||||
php:
|
||||
install: '1'
|
||||
ppa: php5
|
||||
|
Reference in New Issue
Block a user