Copy local file if exists, using ansible

A more comprehensive answer: If you want to check the existence of a local file before performing some task, here is the comprehensive snippet: – name: get file stat to be able to perform a check in the following task local_action: stat path=/path/to/file register: file – name: copy file if it exists copy: src=/path/to/file dest=/destination/path when: … Read more

Vagrant in production

Vagrant should be used more like a staging environment to test your infrastructure changes. It should be your test bed for automated infrastructure changes. The way we use it at my company is like so: Create VMs for our managed servers in Vagrant. Create puppet definitions for each server. Create cucumber tests for each server. … Read more

Why is it not advisable to have the database and web server on the same machine?

Security. Your web server lives in a DMZ, accessible to the public internet and taking untrusted input from anonymous users. If your web server gets compromised, and you’ve followed least privilege rules in connecting to your DB, the maximum exposure is what your app can do through the database API. If you have a business … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)