How to set host_key_checking=false in ansible inventory file?

Due to the fact that I answered this in 2014, I have updated my answer to account for more recent versions of ansible. Yes, you can do it at the host/inventory level (Which became possible on newer ansible versions) or global level: inventory: Add the following. ansible_ssh_common_args=”-o StrictHostKeyChecking=no” host: Add the following. ansible_ssh_extra_args=”-o StrictHostKeyChecking=no” hosts/inventory … Read more

How to automatically install Ansible Galaxy roles?

You should use a requirements.yml file for this use-case. Describe the roles you require, using any of a variety of install methods: # Install a role from the Ansible Galaxy – src: dfarrell07.opendaylight # Install a role from GitHub – name: opendaylight src: https://github.com/dfarrell07/ansible-opendaylight # Install a role from a specific git branch – name: … Read more

How to switch a user per task or set of tasks?

With Ansible 1.9 or later Ansible uses the become, become_user, and become_method directives to achieve privilege escalation. You can apply them to an entire play or playbook, set them in an included playbook, or set them for a particular task. – name: checkout repo git: repo=https://github.com/some/repo.git version=master dest={{ dst }} become: yes become_user: some_user You … Read more

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