diff --git a/README.md b/README.md index 5175584..6ccf587 100755 --- a/README.md +++ b/README.md @@ -22,18 +22,6 @@ Just run: docker-compose up ``` -### [optional] [DEPRECATED] Using a Virtual Machine (VM) - -If you wish to use a ready made VM environment, you can easily create one with Vagrant and Ansible. - -```bash -$ vagrant up -``` - -Then `vagrant ssh` and `cd /vagrant` - -More information on [vagrant](https://www.vagrantup.com) - ### Install dependencies ```bash diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100755 index 30f924c..0000000 --- a/Vagrantfile +++ /dev/null @@ -1,59 +0,0 @@ -################################################## -# Generated by phansible.com -################################################## - -#If your Vagrant version is lower than 1.5, you can still use this provisioning -#by commenting or removing the line below and providing the config.vm.box_url parameter, -#if it's not already defined in this Vagrantfile. Keep in mind that you won't be able -#to use the Vagrant Cloud and other newer Vagrant features. -Vagrant.require_version ">= 1.5" - -# Check to determine whether we're on a windows or linux/os-x host, -# later on we use this to launch ansible in the supported way -# source: https://stackoverflow.com/questions/2108727/which-in-ruby-checking-if-program-exists-in-path-from-ruby -def which(cmd) - exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] - ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| - exts.each { |ext| - exe = File.join(path, "#{cmd}#{ext}") - return exe if File.executable? exe - } - end - return nil -end -Vagrant.configure("2") do |config| - - config.vm.provider :virtualbox do |v| - v.name = "design-patterns" - v.customize [ - "modifyvm", :id, - "--name", "design-patterns", - "--memory", 512, - "--natdnshostresolver1", "on", - "--cpus", 1, - ] - end - - config.vm.box = "ubuntu/trusty64" - - config.vm.network :private_network, ip: "192.168.11.2" - config.ssh.forward_agent = true - - ############################################################# - # Ansible provisioning (you need to have ansible installed) - ############################################################# - - - if which('ansible-playbook') - config.vm.provision "ansible" do |ansible| - ansible.playbook = "ansible/playbook.yml" - ansible.inventory_path = "ansible/inventories/dev" - ansible.limit = 'all' - end - else - config.vm.provision :shell, path: "ansible/windows.sh", args: ["default"] - end - - - config.vm.synced_folder "./", "/vagrant", type: "nfs" -end diff --git a/ansible/inventories/dev b/ansible/inventories/dev deleted file mode 100755 index 86d8f3b..0000000 --- a/ansible/inventories/dev +++ /dev/null @@ -1,2 +0,0 @@ -[phansible-web] -192.168.11.2 diff --git a/ansible/playbook.yml b/ansible/playbook.yml deleted file mode 100755 index 150b16a..0000000 --- a/ansible/playbook.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- hosts: all - become: yes - vars_files: - - vars/all.yml - roles: - - server - - vagrant_local - - php - - xdebug - - app - - composer diff --git a/ansible/roles/app/tasks/main.yml b/ansible/roles/app/tasks/main.yml deleted file mode 100755 index 59e8b64..0000000 --- a/ansible/roles/app/tasks/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# application tasks to be customized and to run after the main provision -- name: update file db - shell: updatedb diff --git a/ansible/roles/composer/tasks/main.yml b/ansible/roles/composer/tasks/main.yml deleted file mode 100644 index 27df507..0000000 --- a/ansible/roles/composer/tasks/main.yml +++ /dev/null @@ -1,10 +0,0 @@ -- name: Install Composer - shell: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer creates=/usr/local/bin/composer - -- name: Increase process timeout - shell: composer --global config process-timeout {{ composer.timeout }} - -- name: Install packages - shell: composer install --optimize-autoloader --prefer-source - args: - chdir: /vagrant \ No newline at end of file diff --git a/ansible/roles/php/tasks/configure.yml b/ansible/roles/php/tasks/configure.yml deleted file mode 100755 index 1b093e7..0000000 --- a/ansible/roles/php/tasks/configure.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- stat: path=/etc/php5/cli/php.ini - register: phpcli - -- include: php-cli.yml - when: phpcli.stat.exists diff --git a/ansible/roles/php/tasks/main.yml b/ansible/roles/php/tasks/main.yml deleted file mode 100755 index 03fede2..0000000 --- a/ansible/roles/php/tasks/main.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: Update apt - apt: update_cache=yes autoremove=yes - -- name: Add ppa Repository - apt_repository: repo=ppa:ondrej/{{ php.ppa }} - -- name: Update apt - apt: update_cache=yes - -- name: Install php7 - apt: pkg=php7.0 state=latest - -- name: Install PHP Packages - apt: pkg="{{ item }}" state=latest - with_items: "{{ php.packages }}" - when: php.packages is defined - -- include: configure.yml diff --git a/ansible/roles/php/tasks/php-cli.yml b/ansible/roles/php/tasks/php-cli.yml deleted file mode 100755 index ae079f2..0000000 --- a/ansible/roles/php/tasks/php-cli.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: enabling opcache cli - lineinfile: - dest: /etc/php/7.0/cli/php.ini - regexp: ';?opcache.enable=\d' - line: 'opcache.enable=1' - -- name: ensure timezone is set in cli php.ini - lineinfile: - dest: /etc/php/7.0/cli/php.ini - regexp: 'date.timezone =' - line: 'date.timezone = {{ server.timezone }}' \ No newline at end of file diff --git a/ansible/roles/server/tasks/main.yml b/ansible/roles/server/tasks/main.yml deleted file mode 100755 index 78efb9f..0000000 --- a/ansible/roles/server/tasks/main.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- name: Update apt - apt: update_cache=yes - -- name: Install System Packages - apt: pkg="{{ item }}" state=latest - with_items: - - curl - - wget - - python-software-properties - -- name: Install Extra Packages - apt: pkg="{{ item }}" state=latest - with_items: "{{ server.packages }}" - when: server.packages is defined - -- name: Configure the timezone - template: src=timezone.tpl dest=/etc/timezone - -- name: More Configure the timezone - 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}} - diff --git a/ansible/roles/server/templates/timezone.tpl b/ansible/roles/server/templates/timezone.tpl deleted file mode 100755 index cca2365..0000000 --- a/ansible/roles/server/templates/timezone.tpl +++ /dev/null @@ -1 +0,0 @@ -{{server.timezone}} diff --git a/ansible/roles/vagrant_local/tasks/main.yml b/ansible/roles/vagrant_local/tasks/main.yml deleted file mode 100755 index 70cad53..0000000 --- a/ansible/roles/vagrant_local/tasks/main.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: Set the hostname in /etc/hostname - shell: echo {{ vagrant_local.vm.hostname }} > /etc/hostname - when: vagrant_local.vm.hostname is defined - -- name: Set the hostname - shell: hostname {{ vagrant_local.vm.hostname }} - 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 diff --git a/ansible/roles/xdebug/defaults/main.yml b/ansible/roles/xdebug/defaults/main.yml deleted file mode 100755 index f2d917e..0000000 --- a/ansible/roles/xdebug/defaults/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -xdebug: - settings: - - xdebug.remote_enable=1 - - xdebug.idekey=PHPSTORM - - xdebug.remote_connect_back=1 - - xdebug.remote_port=9000 diff --git a/ansible/roles/xdebug/tasks/main.yml b/ansible/roles/xdebug/tasks/main.yml deleted file mode 100755 index 380ee2b..0000000 --- a/ansible/roles/xdebug/tasks/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: Install xDebug - apt: pkg=php5-xdebug state=latest diff --git a/ansible/vars/all.yml b/ansible/vars/all.yml deleted file mode 100755 index 25f56c7..0000000 --- a/ansible/vars/all.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -server: - install: '1' - packages: - - vim - - htop - - iotop - - bwm-ng - - git - timezone: UTC - locale: en_US.UTF-8 - -vagrant_local: - install: '1' - vm: - hostname: design-patterns - -php: - install: '1' - ppa: php - packages: - - php7.0-cli - - php7.0-intl - - php7.0-mcrypt - - php7.0-mysql - - php7.0-curl - - php7.0-json - - php7.0-xml - - php7.0-mbstring - -xdebug: - install: '1' - -composer: - timeout: 2400 \ No newline at end of file diff --git a/ansible/windows.sh b/ansible/windows.sh deleted file mode 100755 index eab5d9a..0000000 --- a/ansible/windows.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -# Update Repositories -sudo apt-get update - -# Determine Ubuntu Version -. /etc/lsb-release - -# Decide on package to install for `add-apt-repository` command -# -# USE_COMMON=1 when using a distribution over 12.04 -# USE_COMMON=0 when using a distribution at 12.04 or older -USE_COMMON=$(echo "$DISTRIB_RELEASE > 12.04" | bc) - -if [ "$USE_COMMON" -eq "1" ]; -then - sudo apt-get install -y software-properties-common -else - sudo apt-get install -y python-software-properties -fi - -# Add Ansible Repository & Install Ansible -sudo add-apt-repository -y ppa:ansible/ansible -sudo apt-get update -sudo apt-get install -y ansible - -# Setup Ansible for Local Use and Run -cp /vagrant/ansible/inventories/dev /etc/ansible/hosts -f -chmod 666 /etc/ansible/hosts -cat /vagrant/ansible/files/authorized_keys >> /home/vagrant/.ssh/authorized_keys -sudo ansible-playbook /vagrant/ansible/playbook.yml -e hostname=$1 --connection=local \ No newline at end of file