Ansible 1.6.7+ issue : quote variables with equal signs

I have noticed that on Ansible 1.6.10 my old stable playbooks are not working. It shows an error :
A variable inserted a new parameter into the module args. Be sure to quote variables if they contain equal signs (for example: "{{var}}").

There is a huge conversation on GitHub around different appearances of this isssue.

Solutinon

  • Rollback to Ansible <= 1.6.6 (you can find .deb packages here).
  • Or change your playbook and ad quotes around all shell string that contain "=" sign (atleast I've got such understanding while searchin the solution).

It appears that you can't do something like this now (combine actual shell command and some shell module arguments like creates)

    - name: Configure ZSH (Install oh-my-zsh)
      shell: "{{ item }}"
      with_items:
        - creates='/home/vagrant/.oh-my-zsh' su - vagrant -c 'wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh'
        - sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="jreese"/' /home/vagrant/.zshrc

So with_items now strictly for typical operations with same "template". And in case like above we will need to write separate task for each step (yes I agree that was a mess doing like that... but I liked it for a quick Shell -> Ansible convertation).


Read more ...

Free site up-time monitoring services

uptime

uptimerobot.com

  • Monitors : 50
  • Interval : 5 min
  • Types : http(s), keyword, ping, port
  • Totally free

That's my choice. Atleast this blog is monitored by uptimerobot.com :)

site24x7.com

  • Monitors : 5 (from 1 location)
  • Interval : 10 min

monitor.us

  • Monitors : unlimited
  • Interval : 30 min

Free uptime monitoring via Google Docs

Very interesting trick with Google Spreadsheets scripting, not sure how long it will be available, so can't rely on it for 100%

Also there are a lot of server performance monitoring sytems with trial/limited features where simple ping uptime monitorung could be optained for free, but that is an overkill at my point of view.

If you have more free or even better services, please write it here in comments !


Linux Mint 17 "Qiana" released. How to update from Linux Mint 16.

linux mint logo

Linux Mint 17 is already released for a long time and I have just recently updated Mint 16 to 17.
Very similar as for previuos release.

sudo sed -i 's/saucy/trusty/' /etc/apt/sources.list
sudo sed -i 's/petra/qiana/' /etc/apt/sources.list
sudo sed -i 's/saucy/trusty/' /etc/apt/sources.list.d/official-package-repositories.list
sudo sed -i 's/petra/qiana/' /etc/apt/sources.list.d/official-package-repositories.list
sudo sed -i 's/saucy/trusty/' /etc/apt/sources.list.d/*

sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get upgrade

Dont forget to remove gwendal-lebihan-dev/cinnamon-stable repo if it was enabled previuosly.
Pretty good fly so far , nothing broken (except Plank, but there was some workaround in the web) :)


Increasing Vagrant performance (synced folders)

vagrant

I have started development of PHP web apps with Vagrant and consider that it is a great way to go, but one thing that is annoying - poor performance of web application inside Vagrant.
The reason is slow performance of disk system in shared/synced folders.

Default VM Shared Folders

By default when you configure Vagrant like
config.vm.synced_folder "./", "/var/www"
it uses a standard VirtualBox synced folders mechanism, but it is slow. And you see it as a long response time for a web app (mostly it is because of autolading classes and all hard disk related operations).

There are couple ways to handle it :

rsync

If to change sync configuration to rsync
config.vm.synced_folder "./", "/var/www", type: "rsync"
then vagrant reload
it will not mount synced folder, but will make initial sync of files to local VB storage. And the interesting thing is that VB virtual file system is very fast (unlike shared) and you will see blazing fast performace of app.

But there are tricky places :

  • to make automatic sync of changes on Host system to VB you need to run vagrant rsync-auto each time you are running Vagrant box

  • after each file change it take 2-3 sec. to sync it to VB

  • this sync is one-direction only, you are not able to sync back changes from VB to Host (Vagrant developer considers to implement dual-side sync in future, but currently no)

So currently I consider rsync way as not really universal, but the fastes.

NFS

Another way is to use NFS mounted disk, Vagrant also natively supports it
config.vm.synced_folder "./", "/var/www", type: "nfs"
don't forget vagrant reload

Now it will look in the same way as with Default VB sharing, no need to wait for sync and manually start sync. And performance will be better (but not so good as with rsync).
The only thing - it will not work on Windows and on Linux requires to have NFS packages installe don Host and Vagrant machines.
On Host sudo apt-get install nfs-kernel-server nfs-common portmap.
On Vagrant sudo apt-get install nfs-common portmap.
Also NFS requires Private network (not public or bridget), it should be something like
config.vm.network :private_network, ip: "10.10.11.11"

So after one-time configuration it will work automatically and reliable (this is my choice at the moment for a local development on Linux Host).

Update 2014.08.14 : After some time working on NFS I have faced slowdown once again. In code I have found that mostly it is in functions that uses FS lock. The following config fixed it :
config.vm.synced_folder "./", "/var/www", type: "nfs", nfs_version: "4,nolock"

PHP opcode caching (or similar)

Another speedup option that plays well with above solutions - to use opcode cache in RAM. For PHP there are couple of options APC or Zend Opcache. I am not sure, but for other script languages there could be similar solutions. For example to enable APC on Ubuntu :
~~~ sudo apt-get install php-apc sudo service apache2 restart ~~~ On Vagrant you will see significant PHP application speedup with APC.

Also you can consider this disk performance issue as a good indicator of your app disk usage :) If it is slow on Vagrant - so it is a possible bottleneck on Production.


Read more ...
Ievgen
Kuzminov "iJackUA"
Web Team Lead
at MobiDev (Kharkiv, Ukraine)
Code in Ruby and Elixir, but still love PHP. Explore ES6 and Vue.js. Explore databases, use Ubuntu and MacOS, think about IT people and management

Notes


Have you noticed? Nowadays nobody is doing a New JavaScript framework 😧 These days are over... Everybody is doing their brand new blockchain 😜