Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Fedora and RedHat provisioning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Snape committed Mar 27, 2015
1 parent 6a81e18 commit 1e2f0e4
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 23 deletions.
14 changes: 13 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# limitations under the License.
#=============================================================================

Vagrant.configure('2') do |config|
Vagrant.configure(2) do |config|
if Vagrant.has_plugin?('vagrant-cachier')
config.cache.auto_detect = false
config.cache.enable :apt
Expand All @@ -29,6 +29,18 @@ Vagrant.configure('2') do |config|
end
config.vm.box = 'ubuntu/trusty64'
config.vm.network 'forwarded_port', guest: 80, host: 8080, auto_correct: true
config.vm.provider 'virtualbox' do |virtualbox|
virtualbox.cpus = 2
virtualbox.memory = 4096
end
config.vm.provider 'vmware_fusion' do |vmware_fusion|
vmware_fusion.vmx['memsize'] = 4096
vmware_fusion.vmx['numvcpus'] = 2
end
config.vm.provider 'vmware_workstation' do |vmware_workstation|
vmware_workstation.vmx['memsize'] = 4096
vmware_workstation.vmx['numvcpus'] = 2
end
config.vm.provision 'ansible' do |ansible|
ansible.playbook = 'provisioning/ansible/site.yml'
end
Expand Down
12 changes: 6 additions & 6 deletions docs/installation/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ superset of the requirements for production:

```bash
sudo yum update
sudo yum install cmake curl git httpd mariadb-server memcached nano php php-gd php-mysqlnd php-pdo php-pecl-jsonc php-pecl-memcached php-pecl-xdebug php-pgsql postgresql-server python python-jinja2 python-markdown python-pip python-watchdog PyYAML sqlite subversion
sudo yum install cmake curl git httpd mariadb-server memcached nano php php-bcmath php-gd php-mysqlnd php-pdo php-pecl-jsonc php-pecl-memcached php-pecl-xdebug php-pgsql postgresql-server python python-jinja2 python-markdown python-pip python-watchdog PyYAML sqlite subversion
sudo pip install mkdocs
sudo mkdir -p /var/www/example.org/html
sudo chown $USER:$USER /var/www/example.org/html
Expand Down Expand Up @@ -303,10 +303,10 @@ sudo yum install php

The mod_php5 Apache module is installed along with the PHP preprocessor.

Install the GD and JSON-C PHP extensions:
Install the BC Math, GD, and JSON-C PHP extensions:

```bash
sudo yum install php-gd php-pecl-jsonc
sudo yum install php-bcmath php-gd php-pecl-jsonc
```

!!! important
Expand Down Expand Up @@ -527,7 +527,7 @@ superset of the requirements for production:
```bash
sudo yum install epel-release
sudo yum update
sudo yum install cmake curl git httpd mariadb-server memcached nano php php-gd php-mysqlnd php-pdo php-pecl-memcached php-pecl-xdebug php-pgsql postgresql-server python python-jinja2 python-markdown python-pip PyYAML sqlite subversion
sudo yum install cmake curl git httpd mariadb-server memcached nano php php-bcmath php-gd php-mysqlnd php-pdo php-pecl-memcached php-pecl-xdebug php-pgsql postgresql-server python python-jinja2 python-markdown python-pip PyYAML sqlite subversion
sudo pip install mkdocs
sudo mkdir -p /var/www/example.org/html
sudo chown $USER:$USER /var/www/example.org/html
Expand Down Expand Up @@ -582,10 +582,10 @@ sudo yum install php

The mod_php5 Apache module is installed along with the PHP preprocessor.

Install the GD PHP extension:
Install the BC Math and GD PHP extensions:

```bash
sudo yum install php-gd
sudo yum install php-bcmath php-gd
```

The JSON PHP extension was previously installed along with the PHP
Expand Down
3 changes: 3 additions & 0 deletions provisioning/ansible/roles/apache2/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
- sendmail
when: ansible_pkg_mgr == 'yum'

- name: start apache2
service: name={{ apache2_service }} state=started

- name: enable rewrite module
apache2_module: name=rewrite state=present
notify:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@
ServerName localhost
ServerAdmin webmaster@localhost
DocumentRoot /var/www/vagrant
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
4 changes: 0 additions & 4 deletions provisioning/ansible/roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
- unzip
when: ansible_pkg_mgr == 'apt'

- name: yum update
yum: update_cache=yes
when: ansible_pkg_mgr == 'yum'

- name: yum install epel-release
yum: name=epel-release state=present
when: ansible_distribution in ['CentOS', 'RedHat']
Expand Down
3 changes: 3 additions & 0 deletions provisioning/ansible/roles/memcached/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@
notify:
- restart apache2
when: ansible_pkg_mgr == 'yum'

- name: start memcached
service: name=memcached state=started
9 changes: 6 additions & 3 deletions provisioning/ansible/roles/mysql/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@
- restart apache2
when: ansible_pkg_mgr == 'yum'

- name: db
- name: start mysql
service: name={{ mysql_service }} state=started

- name: mysql db
mysql_db: name={{ item }} state=present
with_items:
- midas
- midas_test

- name: user
mysql_user: user=vagrant password=vagrant priv={{ item }}.*:ALL state=present
- name: mysql user
mysql_user: user={{ ansible_env.SUDO_USER }} password={{ ansible_env.SUDO_USER }} priv={{ item }}.*:ALL state=present
with_items:
- midas
- midas_test
6 changes: 4 additions & 2 deletions provisioning/ansible/roles/php/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
yum: name={{ item }} state=present
with_items:
- php
- php-bcmath
- php-gd
- php-pdo
- php-pecl-xdebug
notify:
- restart apache2
Expand All @@ -62,8 +64,8 @@
- name: curl getcomposer.org
shell: curl https://getcomposer.org/installer | php chdir=/vagrant creates=/vagrant/composer.phar

- name: mv composer.phar
command: mv /vagrant/composer.phar /usr/local/bin/composer creates=/usr/local/bin/composer
- name: cp composer.phar
command: cp /vagrant/composer.phar /usr/local/bin/composer creates=/usr/local/bin/composer

- name: chmod 0755 composer
file: path=/usr/local/bin/composer mode=0755 state=file
Expand Down
22 changes: 22 additions & 0 deletions provisioning/ansible/roles/postgresql/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#=============================================================================
# Midas Server
# Copyright Kitware SAS, 26 rue Louis Guérin, 69100 Villeurbanne, France.
# All rights reserved.
# For more information visit http://www.kitware.com/.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================

---
- name: restart postgresql
service: name=postgresql state=restarted
13 changes: 10 additions & 3 deletions provisioning/ansible/roles/postgresql/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,22 @@
- restart apache2
when: ansible_pkg_mgr == 'yum'

- name: db
- name: init postgresql
command: postgresql-setup initdb creates=/var/lib/pgsql/data/postgresql.conf
when: ansible_os_family == 'RedHat'

- name: start postgresql
service: name=postgresql state=started

- name: postgresql db
postgresql_db: name={{ item }} state=present
with_items:
- midas
- midas_test
sudo_user: postgres

- name: user
postgresql_user: db={{ item }} user=vagrant password=vagrant priv=ALL state=present
- name: postgresql user
postgresql_user: db={{ item }} user={{ ansible_env.SUDO_USER }} password={{ ansible_env.SUDO_USER }} priv=ALL state=present
with_items:
- midas
- midas_test
Expand Down
3 changes: 1 addition & 2 deletions provisioning/ansible/roles/sqlite/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@
- name: yum install
yum: name={{ item }} state=present
with_items:
- php-pdo
- sqlite
notify:
- restart apache2
when: ansible_pkg_mgr == 'yum'

- name: db
- name: sqlite db
file: path={{ item }} state=touch
with_items:
- /vagrant/data/midas.db
Expand Down

0 comments on commit 1e2f0e4

Please sign in to comment.